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 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 Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm

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