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

Syncsort - Incrementing a count value number in the header


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

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Mon Oct 20, 2008 1:06 pm
Reply with quote

Hello,

Here's a Syncsort job which does the same. It involves 2 steps,

Step-1: Takes the count from counter file-1, increment by one, save it back to the counter file, also creates a Symbol - CNT for the new count.
Step-2: Overlays the symbol - CNT into the header record.
Code:
//STEP1    EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD DSN= Count file ----------------- FB,LRECL=6 
//SORTOUT  DD DSN= Count file ----------------- FB,LRECL=6 
//C1       DD DSN=&&C1,DISP=(,PASS),UNIT=SYSDA             
//SYSIN    DD *                                             
  INREC BUILD=(1,6,ZD,ADD,+1,TO=ZDF,LENGTH=6)               
  SORT FIELDS=COPY                                         
  OUTFIL FNAMES=C1,BUILD=(C'CNT,C''',1,6,C'''',80:X)       
//*                                                         
//STEP2    EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SYMNAMES DD DSN=&&C1,DISP=(OLD,PASS)                     
//SORTIN   DD DSN= Input  file ----------------- FB,LRECL=30
//SORTOUT  DD DSN= Output file ----------------- FB,LRECL=30
//SYSIN    DD *                                             
  INREC IFTHEN=(WHEN=(1,3,CH,EQ,C'BOF'),OVERLAY=(11:CNT))   
  SORT FIELDS=COPY       
Back to top
View user's profile Send private message
meltingmemories

New User


Joined: 13 Oct 2008
Posts: 16
Location: Bangalore

PostPosted: Mon Oct 20, 2008 4:02 pm
Reply with quote

icon_biggrin.gif

Thanks A lot!!! It is woking!! Thanks once again for you 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 Goto page Previous  1, 2

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top