View previous topic :: View next topic
|
Author |
Message |
lanand_hps
New User
Joined: 05 Dec 2007 Posts: 82 Location: chennai
|
|
|
|
Hi,
I have a file, the first 7 lines of which is a header.
I want to sort the details that are available from 8th record, leaving the first 7 as it its.
Thanks
Anand |
|
Back to top |
|
|
Ajay Baghel
Active User
Joined: 25 Apr 2007 Posts: 206 Location: Bangalore
|
|
|
|
Hi,
Is there any way to identify the header record so as to distinguish it from trailer record?
Thanks,
Ajay |
|
Back to top |
|
|
Ajay Baghel
Active User
Joined: 25 Apr 2007 Posts: 206 Location: Bangalore
|
|
|
|
Is there any way to identify the header record so as to distinguish it from
record? Sorry, I meant detail records.
-Ajay |
|
Back to top |
|
|
lanand_hps
New User
Joined: 05 Dec 2007 Posts: 82 Location: chennai
|
|
|
|
Yes.
But is it not possible to do it just by knowing the number of rows for a header? First 7 lines are always the header.
(First 4 lines contains date, company name, etc..)
Column name -(6th line)-
----------------- -(7th line) for formatting
Details to be sorted from 8th line. |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
lanand_hps,
The following DFSORT JCL will give you the desired results
Code: |
//STEP0100 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
HEADER1
HEADER2
HEADER3
HEADER4
HEADER5
HEADER6
HEADER7
C
A
D
V
Z
U
Q
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION EQUALS
INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,9,ZD)),
IFTHEN=(WHEN=(81,9,ZD,GT,7),OVERLAY=(81:9C'9'))
SORT FIELDS=(81,09,CH,A,
01,01,CH,A)
OUTREC BUILD=(01,80)
//*
|
|
|
Back to top |
|
|
lanand_hps
New User
Joined: 05 Dec 2007 Posts: 82 Location: chennai
|
|
|
|
Thanks man... |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can now do this kind of thing quite easily with the new DATASORT operator of DFSORT's ICETOOL available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008). Here's an example - change the SORT statement to whatever you need:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file
//OUT DD DSN=... output file
//TOOLIN DD *
DATASORT FROM(IN) TO(OUT) HEADER(7) USING(CTL1)
/*
//CTL1CNTL DD *
SORT FIELDS=(1,1,CH,A)
/*
|
For complete details on the new DATASORT function and the other new functions available with PTF UK90013, see:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
|