View previous topic :: View next topic
|
Author |
Message |
Hritam
New User
Joined: 27 Jun 2005 Posts: 36 Location: India
|
|
|
|
Hi,
I have requirement. Here is the details as follows:
i/p file1:
---------------
10HEADER111/01/2009......
10HEADER211/01/2009......
10HEADER311/01/2009......
20DETAIL1123457..........
20DETAIL2263127..........
20DETAIL3523462..........
20DETAIL4878757..........
20DETAIL5898098..........
20DETAIL6451234..........
20DETAIL7596857..........
90TRAILER000000007.....
Expected o/p file name:
=================
10HEADER111/01/2009......
20DETAIL1123457..........
20DETAIL2263127..........
20DETAIL3523462..........
20DETAIL4878757..........
20DETAIL5898098..........
20DETAIL6451234..........
20DETAIL7596857..........
90TRAILER000000007.....
i/p and o/p record length = 900
Can you help me to find the answer.
I am not able to use IFTHEN WHEN=init as I need to exclude the headers. And not sure of the count of Headers in the file.
A pointer will be appreciated.
Thanks |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Hi,
If I understand the requirement properly,
This code might work,
Code: |
//XK89COP1 JOB ,'KRATOS',CLASS=4,MSGCLASS=Y,NOTIFY=&SYSUID
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=XK89.SORTIN,DISP=SHR
//TEMP1 DD DSN=XK89.SORTOUT,DISP=MOD
//TOOLIN DD *
SUBSET FROM(IN1) TO(TEMP1) INPUT KEEP FIRST(1)
COPY FROM(IN1) TO(TEMP1) USING(CTL1)
/*
//CTL1CNTL DD *
OMIT COND=(1,1,CH,EQ,C'1')
/* |
Hope this helps
P.S - Sortout step uses disp=mod, so you may want to add a DUMMY IDCAMS copy step in front of this step to clear sortout file.
Regards, |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hritam,
I assume you are trying to remove all headers expect the first one and that each header can be identified by a '01' at pos 1-2. You may give the below SyncSort job a try. (Untested)
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN= Input file....FB/900
//SORTIN DD DSN= Output file...FB/900
//SYSIN DD *
INREC IFTHEN=(WHEN=INIT,OVERLAY=(901:8C'0')),
IFTHEN=(WHEN=(1,2,CH,EQ,C'01'),OVERLAY=(901:SEQNUM,8,ZD))
SORT FIELDS=COPY
OUTFIL OMIT=(901,8,ZD,GT,1),BUILD=(1,900)
/* |
|
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Hi Arun,
Quote: |
You may give the below SyncSort job a try. (Untested) |
I am not aware of Syncsort, But are these really sync sort control statements, cos they appear more like DFSORT ones.
Thanks, |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
I am not aware of Syncsort, But are these really sync sort control statements, cos they appear more like DFSORT ones |
SyncSort and DFSORT are competitive products. Most of the basic keywords will work the same way in each of these products.
omg. I just noticed a typo in my previous post. Please read the below line
Code: |
//SORTIN DD DSN= Output file...FB/900 |
as
Code: |
//SORTOUT DD DSN= Output file...FB/900 |
|
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Hi,
Thanks for the information.
They are strikingly similar.
Regards, |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If you look at the informational output from a sort, the product name will be there. |
|
Back to top |
|
|
|