Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
Need help with Syncsort

Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message

Active User

Joined: 28 Aug 2008
Posts: 205
Location: Hyderabad

PostPosted: Fri Oct 09, 2009 3:45 pm    Post subject: Need help with Syncsort
Reply with quote


I have an input file with LRECL=30,RECFM=FB with the below layout:

state pic x(02)
card# pic x(20)
date pic x(08)

there are six state i.e. 01, 02, 03, 04, 05 and 06. Now i need to covert all the card# in state 05 and 06 to 01 and also should make sure that there are no duplicate (state and card# combination). I did write a sort card as shown below:


//JS0001   EXEC PGM=SORT                           
//SYSPRINT DD  SYSOUT=*                             
//SYSOUT   DD  SYSOUT=*                             
//             DSN=xxx.VSAM.D101.TEST.TEMP,         
//             UNIT=3390,DATACLAS=EXTMED,           
//*            SPACE=(CYL,(5,5),RLSE),             
//             LRECL=031,RECFM=FB                   
//SYSIN    DD  *                                   
  INREC OVERLAY=(31:C'1')                           
  SORT FIELDS=(1,2,BI,A,3,20,BI,A,23,8,BI,A)       
  OUTREC IFTHEN=(WHEN=(1,2,CH,EQ,C'04'),           
//JS0002   EXEC PGM=SORT                                               
//SYSOUT   DD  SYSOUT=*                                               
//SYSPRINT DD  SYSOUT=*                                               
//SORTIN   DD  DISP=SHR,DSN=xxx.VSAM.D101.TEST.TEMP                   
//SORTOUT  DD  DISP=(,CATLG,DELETE),                                   
//             DATACLAS=EXTLRG,                                       
//             DCB=(LRECL=80,RECFM=FB),                               
//             DSN=xxx.VSAM.D101.TEST.TEMP2                           
//SYSIN    DD  *                                                       
  SORT FIELDS=(1,2,BI,A,3,20,BI,A,31,1,BI,A)                           
//STEP0060 EXEC PGM=SORT                                   
//SYSOUT   DD  SYSOUT=*                                   
//SYSPRINT DD  SYSOUT=*                                   
//SORTOUT  DD  DISP=(,CATLG,DELETE),                       
//             DATACLAS=EXTLRG,                           
//             DCB=(LRECL=30,RECFM=FB),                   
//             DSN=xxx.D101.TEST                     
//SORTXSUM DD  SYSOUT=*                                   
//SYSIN    DD  *                                           
  SORT FIELDS=(1,2,BI,A,3,20,BI,A)                         
  SUM FIELDS=NONE,XSUM                                     
  OUTREC BUILD=(1:1,30)                                   

This is working for me. But i need to confirm how many card for banner 04 and 05 were changed 01 in first step. can anyone help with this.

PS: all the files in the job are flat files and the last file i need to copy/repro into a VSAM file.

Back to top
View user's profile Send private message


Senior Member

Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Mon Oct 12, 2009 3:35 am    Post subject:
Reply with quote


why not compare the 2 files ?

or obtain a count before and after the update.

Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1


Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Reformatting and adding additional fi... Badbeef SYNCSORT 6 Thu Apr 05, 2018 4:45 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 7 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am

Back to Top
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us