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
 

 

Writing Detail and Trailer using SYNCSORT

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

New User


Joined: 08 Jun 2009
Posts: 36
Location: Bangalore

PostPosted: Wed Aug 18, 2010 9:47 pm    Post subject: Writing Detail and Trailer using SYNCSORT
Reply with quote

Though I fetched many threads but could not find a solution

Input File has:

Header - 1st column = 0
Detail recs - 1st col = 1
Trailer - 1st column = 9

Code:
000100 0021720101326                           
000200 1A458746987456JKDJSJD7845T             
000300 1A3464587486HJDSFHJKFDGKHFDKK           
000400 1B3647845JKDGHJDFGHJDFGHJDFGHJ         
000500 1B3545433IEIEIJJHJHJDFGHJDFGHJ         
000600 1AJSDGSDKFKJ95794679KJDGJKDSFGJK       
000700 9        502172010                     


I need to have to output files.
Out file 1:
1) Should have header record as it is in Input file
2) Should have records with 1st col = 1 & 2nd column = 'A'
3) Trailer having count of records (Count should exclude header & trailer)

So it shud look like:

Code:
000100 0021720101326                           
000200 1A458746987456JKDJSJD7845T             
000300 1A3464587486HJDSFHJKFDGKHFDKK           
000400 1AJSDGSDKFKJ95794679KJDGJKDSFGJK
000500 000000003


Out file 2:
Out file 1:
1) Should have header record as it is in Input file
2) Should have records with 1st col = 1 & 2nd column = 'B'
3) Trailer having count of records (Count should exclude header & trailer)

I tried with the following Sort Card:

Code:
OPTION COPY
OUTFIL FNAMES=FILE1,INCLUDE=(1,1,CH,EQ,C'0',OR,1,1,CH,EQ,C'1',   
          AND,2,1,CH,EQ,C'A'),REMOVECC,TRAILER1=(COUNT-1=(M11,LENGTH=9))   
OUTFIL FNAMES=FILE2,INCLUDE=(1,1,CH,EQ,C'0',OR,1,1,CH,EQ,C'1',   
          AND,2,1,CH,EQ,C'B'),REMOVECC,TRAILER1=(COUNT-1=(M11,LENGTH=9))     



But this is giving syntax error:
Code:

WER268A  OUTFIL STATEMENT  : SYNTAX ERROR
WER268A  OUTFIL STATEMENT  : SYNTAX ERROR



PS: I am using SYNCSORT

ANy help would be much appreciated.

Thanks and regards,
Vivek
Back to top
View user's profile Send private message

Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Wed Aug 18, 2010 11:47 pm    Post subject:
Reply with quote

Hello Vivek.

Here are the SyncSort for z/OS control statements that should give you the requested output:
Code:
//SYSIN DD  *                                               
 SORT FIELDS=COPY                                           
 OUTFIL FILES=01,INCLUDE=(1,1,CH,EQ,C'0',OR,1,2,CH,EQ,C'1A'),
        REMOVECC,TRAILER1=(COUNT-1=(EDIT=(TTTTTTTTT)))       
 OUTFIL FILES=02,INCLUDE=(1,1,CH,EQ,C'0',OR,1,2,CH,EQ,C'1B'),
        REMOVECC,TRAILER1=(COUNT-1=(EDIT=(TTTTTTTTT)))       
/*                                                           
Back to top
View user's profile Send private message
viveksurya

New User


Joined: 08 Jun 2009
Posts: 36
Location: Bangalore

PostPosted: Thu Aug 19, 2010 2:17 pm    Post subject:
Reply with quote

Many thanks Alissa. It is working fine.

Just an additional query.

How can we have count in the Trailer written in Packed-Decimal format..??

I tried :

Code:
SORT FIELDS=COPY                                               
 OUTFIL FILES=01,INCLUDE=(1,1,CH,EQ,C'0',OR,1,2,CH,EQ,C'1A'), 
        REMOVECC,TRAILER1=(COUNT-1=PD)                         
 OUTFIL FILES=02,INCLUDE=(1,1,CH,EQ,C'0',OR,1,2,CH,EQ,C'1B'), 
        REMOVECC,TRAILER1=(COUNT-1=PD)                         



But this is giving syntax error.


Thanks and regards,
Vivek
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Thu Aug 19, 2010 8:18 pm    Post subject:
Reply with quote

Hello Vivek.

To convert the COUNT field to PD format, you must specify the length subparameter. Try the following:
Code:
TRAILER1=(COUNT-1=(PD,LENGTH=5))
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 SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 5 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
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm


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