Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SYNCSORT counting number of variables of records.

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

New User


Joined: 30 Sep 2008
Posts: 9
Location: Chennai

PostPosted: Wed Oct 01, 2008 7:44 pm    Post subject: SYNCSORT counting number of variables of records.
Reply with quote

My input file contains records like:

abcdefghijklmno20080925abcdefghijkl
abcdefghijklmno20080926abcdefghijkl
abcdefghijklmno20080926abcdefghijkl
abcdefghijklmno20080926abcdefghijkl
abcdefghijklmno20080925abcdefghijkl
abcdefghijklmno20080925abcdefghijkl
abcdefghijklmno20080927abcdefghijkl
abcdefghijklmno20080927abcdefghijkl
abcdefghijklmno20080927abcdefghijkl
abcdefghijklmno20080927abcdefghijkl

Every record consists of date.
My output file looks like: it consists of header and trailer.

Header00140 12520080915abc
abcdefghijklmno20080925abcdefghijkl
abcdefghijklmno20080926abcdefghijkl
abcdefghijklmno20080926abcdefghijkl
abcdefghijklmno20080926abcdefghijkl
abcdefghijklmno20080925abcdefghijkl
abcdefghijklmno20080925abcdefghijkl
abcdefghijklmno20080927abcdefghijkl
abcdefghijklmno20080927abcdefghijkl
abcdefghijklmno20080927abcdefghijkl
abcdefghijklmno20080927abcdefghijkl
Trailer017825

The date in header in output file is run date of job. But, we want to change the date should be the date that is contained in maximum number of records in the input. Such as we need to count the occurences of date from input file,and want to change the date in header to that date. Like in example: above input file consists 20080927 four times- so my requirement is to change output file header date i.e. 20080915 to 20080927.
Back to top
View user's profile Send private message

Arun Raj

Moderator


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

PostPosted: Wed Oct 01, 2008 7:55 pm    Post subject:
Reply with quote

Amit Chadha,

Are you trying to do this by taking the Output file given above as input? Or the input file? Also can you post some more details like input RECFM,LRECL etc
Back to top
View user's profile Send private message
amitchadha30

New User


Joined: 30 Sep 2008
Posts: 9
Location: Chennai

PostPosted: Wed Oct 01, 2008 8:16 pm    Post subject: Reply to: SYNCSORT counting number of variables of records.
Reply with quote

I am reading the input file and adding header & trailer with maximum occuring dates in input should come on header date. I am able to put run date on header but want to replace run date to maximum occuring date in input file.
Input file- RECFM=FBA,LRECL=133
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Thu Oct 02, 2008 8:53 pm    Post subject:
Reply with quote

Amit,

Here's a SYNCTOOL job which works for your requirement. I have assumed the output file has the same attributes as that of input (FBA, LRECL=133).
Code:
//STEP1    EXEC PGM=SYNCTOOL                                     
//TOOLMSG  DD SYSOUT=*                                           
//DFSMSG   DD SYSOUT=*                                           
//T1       DD DSN=&&T1,DISP=(,PASS),DCB=RECFM=FB                 
//C1       DD DSN=&&C1,DISP=(,PASS)                               
//IN       DD DSN= Input file                                     
//OUT      DD DSN= Output file                                   
//TOOLIN   DD *                                                   
 SORT FROM(IN) TO(T1)  USING(CTL1)                               
 SORT FROM(T1) TO(C1)  USING(CTL2)                               
 COPY FROM(IN) TO(OUT) USING(CTL3)                               
//CTL1CNTL DD *                                                   
 SORT FIELDS=(17,8,CH,A)                                         
 OUTREC BUILD=(17,8,9:SEQNUM,8,ZD,RESTART=(17,8))                 
//CTL2CNTL DD *                                                   
 SORT FIELDS=(9,8,CH,D)                                           
 OUTFIL REMOVECC,ENDREC=1,                                       
 BUILD=(C' OUTFIL HEADER1=(''Header XXXXXXX '',C''',1,8,C'''),',/,
        C' TRAILER1=(''Trailer YYYY ''),BUILD=(2,132)')           
//CTL3CNTL DD DSN=*.C1,VOL=REF=*.C1,DISP=(OLD,PASS)     

OUT
Code:
Header XXXXXXX 20080927           
abcdefghijklmno20080925abcdefghijkl
abcdefghijklmno20080926abcdefghijkl
abcdefghijklmno20080926abcdefghijkl
abcdefghijklmno20080926abcdefghijkl
abcdefghijklmno20080925abcdefghijkl
abcdefghijklmno20080925abcdefghijkl
abcdefghijklmno20080927abcdefghijkl
abcdefghijklmno20080927abcdefghijkl
abcdefghijklmno20080927abcdefghijkl
abcdefghijklmno20080927abcdefghijkl
Trailer YYYY
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 Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
No new posts Edit large number of datasets (QSAM) zh_lad TSO/ISPF 3 Tue Apr 04, 2017 6:08 pm
No new posts how to mask the phone number kumarinfy DB2 4 Mon Apr 03, 2017 5:23 pm
No new posts what is meaning of the number in dcl Martylin PL/I & Assembler 2 Thu Mar 09, 2017 7:18 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us