Posted: Wed Dec 17, 2008 7:50 am Post subject: Grouping records in DFSORT
Hi
I am having a report file of record length 80. I need to extract all detail records of headers having "A" in position 1. Input file contains n number of different headers also.
INPUT:
Code:
AH
1
2
3
T
BH
4
5
6
T
CH
7
8
9
T
AH
0
T
EH
0
1
3
T
H ---> HEADER
T ---> TRAILER
REQUIRED OUTPUT:
Code:
AH
1
2
3
T
AH
0
T
I have created a 3 pass job for this.
Is it possible to do it in 2 pass or 1 pass?
Note: We do not have z/OS DFSORT V1R5 PTF UK90013 (July, 2008). So I cannot use WHEN=GROUP.
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Wed Dec 17, 2008 10:24 am Post subject:
oneofspace,
The following DFSORT/ICETOOL JCL will give you the desired results. Since you don't have the latest PTF which supports Group functions we have to use splice to get the desired results.
If you had the the latest PTF, you can very easily split using the new WHEN=GROUP function of DFSORT available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008) like this:
Code:
//STEP0200 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
AH
1
2
3
T
BH
4
5
6
T
CH
7
8
9
T
AH
0
T
EH
0
1
3
T
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(2,1,CH,EQ,C'H'),PUSH=(81:1,2))
OUTFIL INCLUDE=(81,2,CH,EQ,C'AH'),BUILD=(1,80)
/*
Ask your System Programmer to install it (it's free).
For complete details on the new WHEN=GROUP and the other new functions available with PTF UK90013, see:
One more question.
We are having a cobol program to do the above said requirement.
File details are lrecl is 133, record format is FBA, contains more than 1.3 million records.
Just to replace the cobol program I tried DFSORT.
Considering TOTAL CPU TIME, Cobol program takes .00 and our new job takes .03. So people are not accepting. .....
I am much eager to know the reason. Could you please explain?
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Thu Dec 18, 2008 11:23 am Post subject:
oneofspace wrote:
Considering TOTAL CPU TIME, Cobol program takes .00 and our new job takes .03. So people are not accepting. .....
I am much eager to know the reason. Could you please explain?
Thanks
One.
Are you sure you got the cpu time right? Even though we are splicing I have SORT FIELDS=COPY override on splice which is basically does a copy and more efficient. I would like to see the complete sysout of the job including JES messages. _________________ Kolusu
www.linkedin.com/in/kolusu
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Thu Dec 18, 2008 11:55 am Post subject:
Quote:
I have a doubt. Whether any changes need to be done in control card if the record format is FBA?
FBA records have a carriage control character in position 1, so the data actually starts in position 2. You would have to adjust the starting positions of all of the fields accordingly, and account for the different LRECL.
Quote:
Are you sure you got the cpu time right? Even though we are splicing I have SORT FIELDS=COPY override on splice which is basically does a copy and more efficient.
Not to mention that the OP couldn't use the WHEN=GROUP solution which would be even more efficient. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Fri Dec 19, 2008 2:42 pm Post subject:
In an offline note, the original poster indicated he's using Syncsort, not DFSORT, so I don't know why he's saying he tried DFSORT. And obviously, the reason he can't use WHEN=GROUP is because he doesn't have DFSORT. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum