Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
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
 
SyncSort help for Multiple Header file on header title

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

New User


Joined: 29 Nov 2006
Posts: 2
Location: bangalore

PostPosted: Mon Nov 09, 2009 5:44 pm    Post subject: SyncSort help for Multiple Header file on header title
Reply with quote

I have an Input file which has multiple headers.Each header file has 'n' number of records.The format of the input file is as below:

------------------------------------------ DB2 SUBSYSTEM ID=DB2T DATE=11
BISWA BISWA 3 6 0
DEOGH DEOGH 26 72 3

----------------------------------------- DB2 SUBSYSTEM ID=DB2T DATE=11
DEOGH DEOGH 4 8 1
RETNA RETNA 8 8 0
RETNAI RETNA 4 574 0

----------------------------------------- DB2 SUBSYSTEM ID=DB2I DATE=11
DEOGH DEOGH 4 9 1
.
.
.
..
.
The header which is in the format '----------------------------------------- DB2 SUBSYSTEM ID=DB2T .....' can have the SUBSYSTEM id either as DB2T or DB2I.This value starts in column 63 and as obvious is of length 4.


Now ,I have to split this file to two output files with one file having all the detail Header and records pertaining to 'DB2T' and the other for 'DB2I'.
For e.g The output for File1 should look like:
------------------------------------------ DB2 SUBSYSTEM ID=DB2T DATE=11
BISWA BISWA 3 6 0
DEOGH DEOGH 26 72 3

----------------------------------------- DB2 SUBSYSTEM ID=DB2T DATE=11
DEOGH DEOGH 4 8 1
RETNA RETNA 8 8 0
RETNAI RETNA 4 574 0


How can I do this split using SYNCSORT/SYNCTOOL.
Back to top
View user's profile Send private message

Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Thu Nov 12, 2009 3:21 am    Post subject:
Reply with quote

Hello Sudeep.

Assuming your file is FB/80, you can use the following SyncSort for z/OS 1.3.2 step:
Code:

//STEP1  EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=INPUT.FILE
//SORTOF01 DD DSN=DB2T.OUTPUT
//SORTOF02 DD DSN=DB2I.OUTPUT
//SYSIN    DD *
  SORT FIELDS=COPY                                                   
  OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(1,4,CH,EQ,C'----'),PUSH=(81:63,4))
  OUTFIL FILES=01,INCLUDE=(81,4,CH,EQ,C'DB2T'),BUILD=(1,80)         
  OUTFIL FILES=02,SAVE,BUILD=(1,80)                                 
/*   
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 Compare yesterday's date to the one o... migusd SYNCSORT 7 Fri Sep 22, 2017 11:35 pm
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm
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 BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts PLI - printing from multiple programs Pedro PL/I & Assembler 8 Fri Sep 08, 2017 6:36 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us