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

Need help with Syncsort


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

Active User


Joined: 28 Aug 2008
Posts: 205
Location: Hyderabad

PostPosted: Fri Oct 09, 2009 3:45 pm
Reply with quote

HI

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:

Code:

//JS0001   EXEC PGM=SORT                           
//SYSPRINT DD  SYSOUT=*                             
//SYSOUT   DD  SYSOUT=*                             
//SORTIN   DD DISP=SHR,DSN=xxx.VSAM.D101.ENROLL     
//SORTOUT  DD  DISP=(NEW,CATLG,DELETE),             
//             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'),           
         OVERLAY=(1:C'01',31:C'2')),               
         IFTHEN=(WHEN=(1,2,CH,EQ,C'05'),           
         OVERLAY=(1:C'01',31:C'3'))                 
/*                                                 
//*                                                 
//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=*                                   
//SORTIN   DD  DISP=SHR,DSN=xxx.VSAM.D101.TEST.TEMP2       
//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.

Thanks,
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

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

Hi,

why not compare the 2 files ?

or obtain a count before and after the update.


Gerry
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 only first records of the fil... SYNCSORT 7
No new posts Count Records with a crietaria in a f... DFSORT/ICETOOL 5
No new posts DFSORT/SYNCSORT/ICETOOL JCL & VSAM 8
No new posts Syncsort "Y2C" Function SYNCSORT 1
No new posts Arithmetic division using Syncsort SYNCSORT 6
Search our Forums:

Back to Top