MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to merge Two PS files with different Key columns
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
sankar narayanan
Beginner


Joined: 16 Oct 2007
Posts: 29
Topics: 12

PostPosted: Sat Nov 03, 2007 4:41 am    Post subject: How to merge Two PS files with different Key columns Reply with quote

Hi;
I want to Merge a two PS file(both are in sorted format) to a single PS,but the columns key are different in Both the input files.

Here is the Jcl:
Code:

//SORTIN01  DD DSN=XXXXX.FILE1,DISP=SHR     
//SORTIN02  DD DSN=XXXXX.FILE2,DISP=SHR     
//SORTOUT   DD DSN=XXXXX.FILE3,             
//             DISP=(,CATLG,CATLG),UNIT=WRKDA,
//             SPACE=(TRK,(225,125),RLSE),     
//             DCB=XXXXX.FILE1               
//SYSOUT    DD SYSOUT=*                       
//SYSPRINT  DD SYSOUT=*                       
//SYSIN DD *                                   
  MERGE FIELDS=(1,04,CH,A)                     
/*                                             

Code:

File1:(key 1-4)
----+----1----+----2----+----3--
********************************
1111  ramam                   
2222  kumar                   
3333  raja                     
4444  kumar                     
********************************

File2:(key 12-15)
----+----1----+----2----+----3----+----
********************************* Top o
developer 1111                       
employed 2222                       
salaried    3333                       
bussiness  4444                       
******************************** Bottom

Can any one let me how to approach on this thru a JCL.

Thx;
Sank.
Back to top
View user's profile Send private message
krisprems
Beginner


Joined: 13 Dec 2006
Posts: 101
Topics: 4
Location: india

PostPosted: Sat Nov 03, 2007 7:32 am    Post subject: Reply with quote

Hello sankar narayanan
How should the output look like?
_________________
cHEERs
krisprems
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Sat Nov 03, 2007 10:41 am    Post subject: Reply with quote

Also, what is the RECFM and LRECL of each input file?
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sankar narayanan
Beginner


Joined: 16 Oct 2007
Posts: 29
Topics: 12

PostPosted: Sun Nov 04, 2007 11:43 pm    Post subject: Reply with quote

Hi

I need the output format to be in two ways.

O/P 1:
Code:

----+----1----+----2----+----3----+-
********************************* To
1111 RAMAM DEVELOPER               
2222 KUMAR EMPLOYED                 
3333 RAJA    SALARIED                 
4444 KUMAR BUSSINESS               
******************************** Bot

O/P 2:
----+----1----+----2----+----3----+-
********************************* To
1111 RAMAM                         
1111 DEVELOPER                     
2222 KUMAR                         
2222 EMPLOYED                       
3333 RAJA                           
3333 SALARIED                       
4444 KUMAR                         
4444 BUSSINESS                     
******************************** Bot

The RECFM=FB and LRECL=80 for each input file and the O/P file RECFM=VB and LRECL=2000.

Rgds
Sank.
Back to top
View user's profile Send private message
sankar narayanan
Beginner


Joined: 16 Oct 2007
Posts: 29
Topics: 12

PostPosted: Sun Nov 04, 2007 11:57 pm    Post subject: Reply with quote

Hi
Just adding to the above words.I need the approach to be done only thru JCL and not Thru any Programs or Ezytrives.

Rgds
Sank.
Back to top
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Mon Nov 05, 2007 12:11 am    Post subject: Reply with quote

sankar narayanan,

pls check the below link
http://www.mvsforums.com/helpboards/viewtopic.php?t=10&postdays=0&postorder=asc&highlight=merge+lateral&&start=0
Back to top
View user's profile Send private message Send e-mail
krisprems
Beginner


Joined: 13 Dec 2006
Posts: 101
Topics: 4
Location: india

PostPosted: Mon Nov 05, 2007 1:02 am    Post subject: Reply with quote

sankar narayanan
Here you go...
Code:
//*******************************************************               
//STEP001  EXEC PGM=ICETOOL                                             
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*                                                 
//IN1      DD DSN=i/p-1 (FB,80)
//IN2      DD DSN=i/p-2 (FB,80)
//TMP1     DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA 
//OUT1     DD DSN=o/p-1 (VB,2000)
//OUT2     DD DSN=o/p-2 (VB,2000)
//TOOLIN   DD *                                                         
 COPY FROM(IN1)  TO(TMP1)                                               
 COPY FROM(IN2)  TO(TMP1) USING(CP01)                                   
 SPLICE FROM(TMP1) TO(OUT2) ON(1,4,ZD) WITH(15,10) USING(CP02)         
/*                                                                     
//CP01CNTL DD   *                                                       
  OUTREC BUILD=(11,4,15:1,10)                                           
/*                                                                     
//CP02CNTL DD   *                                                       
  OUTFIL FNAMES=OUT1,BUILD=(1,76),FTOV                                 
  OUTFIL FNAMES=OUT2,BUILD=(1,10,/,1,5,6:15,10),FTOV                   
/*                                                                     
   



OUT1:
Code:
1111 RAMAM    DEVELOPER 
2222 KUMAR    EMPLOYED   
3333 RAJA     SALARIED   
4444 KUMAR    BUSSINESS 

OUT2:
Code:
1111 RAMAM   
1111 DEVELOPER
2222 KUMAR   
2222 EMPLOYED
3333 RAJA     
3333 SALARIED
4444 KUMAR   
4444 BUSSINESS

_________________
cHEERs
krisprems
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Mon Nov 05, 2007 12:08 pm    Post subject: Reply with quote

Krisprems,

Sankar is wanting it done by JCL only (not possible), not by a program. Your solution uses program ICETOOL (PGM=ICETOOL).
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
krisprems
Beginner


Joined: 13 Dec 2006
Posts: 101
Topics: 4
Location: india

PostPosted: Mon Nov 05, 2007 1:25 pm    Post subject: Reply with quote

Nic Clouston

Quote:

Sankar is wanting it done by JCL only (not possible), not by a program. Your solution uses program ICETOOL (PGM=ICETOOL).


Well Said!!

But for some people feel ICETOOL, SORT, FAID as just a JCL. Razz
_________________
cHEERs
krisprems
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon Nov 05, 2007 1:51 pm    Post subject: Reply with quote

Quote:
Just adding to the above words.I need the approach to be done only thru JCL and not Thru any Programs or Ezytrives.


Since the first post showed a sort job, I would take this to mean no programs and not EZTRIEVE, but sort is ok.

When people say "JCL" here they generally mean a utility as opposed to a program they'd have to write. Yes, it's incorrect terminology, but ...
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
krisprems
Beginner


Joined: 13 Dec 2006
Posts: 101
Topics: 4
Location: india

PostPosted: Mon Nov 05, 2007 10:20 pm    Post subject: Reply with quote

Quote:

Quick Reply
When people say "JCL" here they generally mean a utility as opposed to a program they'd have to write. Yes, it's incorrect terminology, but ...

Yes Frank thats true, it has become an convention that if we could embed the code(like SORT CARD) within the JCL then it becomes a JCL solution rather than SORT Solution Rolling Eyes Wink bonk
_________________
cHEERs
krisprems
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Tue Nov 06, 2007 12:45 pm    Post subject: Reply with quote

So how would you classify a compile/link/go job where the code is inline (PL/1 in my case)? JCL or application program? Mr. Green

Yes, I realise people mean a batch job - probably sort or another utility - but that does ot mean theu should not be precise. Frank is always asking for precise details. Getting the thread into the right area would be nice - I look for JCL problems to resolve - not SORT etc. (If I want to do other things then I look in the appropriate area.)
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue Nov 06, 2007 1:20 pm    Post subject: Reply with quote

I think we'd all agree that it would be great if everyone used the correct terminology and the correct Forums. But unfortunately we have to live with the reality that they don't. You're free to keep pointing out what JCL is and isn't, but it might not do much good since most people don't seem to care about using correct terminology. I've gotten to the point where I only ask for clarification if I need it to come up with a solution. I often just make assumptions rather than asking for clarification. Such is life in the help board jungle. Sad
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sankar narayanan
Beginner


Joined: 16 Oct 2007
Posts: 29
Topics: 12

PostPosted: Tue Nov 13, 2007 12:04 am    Post subject: Reply with quote

Hi krisprems;

The JCL is getting abend with MAXCC=20.
Plz look to my JCl and correct me if i am wrong in any part of it.

//xxxxxxxP JOB (0009Z,,,CC),'TEST REPT',
// MSGCLASS=L,CLASS=A,NOTIFY=&SYSUID
//*
//STEP02 EXEC PGM=ICETOOL
//IN1 DD DSN=xxxxx.FILE1,DISP=SHR
//IN2 DD DSN=xxxxx.FILE2,DISP=SHR
//TMP1 DD DSN=&&TEMP1,DISP=(MOD,PASS),
// SPACE=(TRK,(5,5)),UNIT=TSTDA
//OUT1 DD DSN=xxxxx.FILE4,DISP=MOD
//OUT2 DD DSN=xxxxx.FILE5,DISP=MOD
//TOOLIN DD *
COPY FROM(IN1) TO(TMP1)
COPY FROM(IN2) TO(TMP1) USING(CP01)
SPLICE FROM(TMP1) TO(OUT2) ON(1,4,ZD) WITH(15,10) USING(CP02)
/*
//CP01CNTL DD *
OUTREC BUILD=(11,4,15:1,10)
/*
//CP02CNTL DD *
OUTFIL FNAMES=OUT1,BUILD=(1,76),FTOV
OUTFIL FNAMES=OUT2,BUILD=(1,10,/,1,5,6:15,10),FTOV
/*

Here File1 and File2 Recfm=FB, Lrecl =80.///ly File4 and File5 Recfm=VB, Lrecl = 2000.

Regds
Sank
Back to top
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Tue Nov 13, 2007 12:39 am    Post subject: Reply with quote

sankar narayanan

You have to post the error messages from the joblog.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group