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

SyncSort help for Multiple Header file on header title


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 496
Location: USA

PostPosted: Thu Nov 12, 2009 3:21 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top