IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SYNCSORT - populate the records in ONE output file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sankarganga

New User


Joined: 16 Feb 2009
Posts: 3
Location: bangalore

PostPosted: Tue Sep 20, 2011 12:18 pm
Reply with quote

Hi,
I have used following SORT card to get the Matching/Not matching records to FILE01 and FILE02.

Code:
JOINKEYS FILES=F1,FIELDS=(11,12,A,23,2,A)                           
JOINKEYS FILES=F2,FIELDS=(1,12,A,14,2,A)                             
JOIN UNPAIRED,F1,F2                                                 
REFORMAT FIELDS=(F1:1,47,F2:33,10),FILL=X'00'                       
SORT FIELDS=COPY                                                     
OUTFIL FILES=01,INCLUDE=(1,1,BI,NE,X'00',AND,48,1,BI,NE,X'00'),     
OUTREC=(1:1,57)                                                     
OUTFIL FILES=02,INCLUDE=(1,1,BI,NE,X'00',AND,48,1,BI,EQ,X'00'),     
OUTREC=(1:1,47,48:&DATE(4MD-))     

Now, is there any way to populate the records in ONE output file.
Back to top
View user's profile Send private message
kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Tue Sep 20, 2011 2:25 pm
Reply with quote

Yes you can.

Collaborate all your include conditions. Use IFTHEN against seperate conditions to build the output file.
Back to top
View user's profile Send private message
sankarganga

New User


Joined: 16 Feb 2009
Posts: 3
Location: bangalore

PostPosted: Tue Sep 20, 2011 4:38 pm
Reply with quote

Thanks for the reply kartos86

i used following code to format the records into single OUTFILE.
JOINKEYS FILES=F1,FIELDS=(11,12,A,23,2,A)
JOINKEYS FILES=F2,FIELDS=(1,12,A,14,2,A)
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F1:1,47,F2:33,10)
SORT FIELDS=COPY
OUTFIL FILES=01,IFTHEN=(WHEN=(48,1,CH,NE,C' '),
BUILD=(1,57)),
IFTHEN=(WHEN=NONE,BUILD=(1,47,&DATE))

But here I am not able to format the DATE to YYYY-MM-DD. its is giving syntax error for &DATE(4MD-)
Back to top
View user's profile Send private message
sankarganga

New User


Joined: 16 Feb 2009
Posts: 3
Location: bangalore

PostPosted: Tue Sep 20, 2011 5:49 pm
Reply with quote

i got the solution.

JOINKEYS FILES=F1,FIELDS=(11,12,A,23,2,A)
JOINKEYS FILES=F2,FIELDS=(1,12,A,14,2,A)
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F1:1,47,F2:33,10)
SORT FIELDS=COPY
OUTFIL FILES=01,IFTHEN=(WHEN=(48,1,CH,NE,C' '),
BUILD=(1,57)),
IFTHEN=(WHEN=NONE,BUILD=(1,47,&DATE(4MD-)))

thanks for the support.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
Search our Forums:

Back to Top