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 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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 6 Fri Mar 24, 2017 2:24 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 3 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm


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