Posted: Wed Sep 13, 2006 9:26 am Post subject: multiple header and detail records
I have file with multiple header and detail records.
I need to create output file only where header has 'NG4' in positin 3 and detail record
has '1' in position 47. output file should have only menber# start from 2 pos 20 bite and
group# start from 22 pos 15 bite.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Wed Sep 13, 2006 10:31 am Post subject:
Your example shows a 1 in 47 for every detail record in every NG4 group so it's hard to know exactly what you want. Can an NG4 group have a detail record without a 1 in 47? If so, for such an NG4 group do you want (1) any details records that have a 1 in 47 (2) no detail records unless every detail record has a 1 in 47 (3) all detail records if any detail record has a 1 in 47 or (4) ?
For example, what would you want for the output record if you had an NG4 group like this for input?
_________________ 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: Wed Sep 13, 2006 2:13 pm Post subject:
You didn't actually answer my question. Please tell me the output records you want for the input records I showed. Note that it's an NG4 group with a '1' in 47 for the first record, a '2' in 47 for the second record, a '1' in 47 for the third record, and a '4' in 47 for the fourth record. Do you just want the first and third records with the two fields, or do you want something else? _________________ 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
Sorry for the delay, I was really busy, and now I can come back to the issue.
I have a file with multiple header records and detail records under each header.
First, I need to check each header record. If it has certain value in position (3:3) only then, check each detail record for the value of "1" in position 47. If both criteria are met, then write only two fields from the input file detail record starting from the following positions (2:20 and 22:15) to the output.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Wed Sep 13, 2006 7:08 pm Post subject:
You just keep repeating the same thing over and over and ignoring my question. I'm trying to help but I need to know what you want to do when an NG4 group has some detail records with a '1' in 47 and some detail records with something else in 47.
I'll ask the question again. Please answer this time.
Say you have an input group like this with a '1' in 47 for the first detail record, a '2' in 47 for the second detail record, a '1' in 47 for the third detail record, and a '4' in 47 for the fourth detail record.
Would you want the following input (the two fields from the first and third detail records):
Code:
748486297736 AMANCOB2
150735215184 HCORPCOBCDH
And another question - does B in position 1 indicate a header record and C in position 1 indicate a detail record? _________________ 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
'1' in position 47 can be in any detail records, it can be in 2,3,4,5 .... and i need only records where '1'.
'B' header records
'C' detail records
your code it in exactly what i need
Thank you very much
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Thu Sep 14, 2006 11:06 am Post subject:
Here's a DFSORT/ICETOOL job that will do what you asked for. You'll need z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) to do this in one pass as shown. The job won't work correctly (probably no OUT output) if you don't have that PTF. If you see 'ICE201I E' in //DFSMSGS, then you have the PTF. If you see 'ICE201I 0', then you don't have the PTF and you'll need to do this in two passes using a temporary data set - a COPY operator with the INREC statement, and the SPLICE operator with the OUTFIL statement.
_________________ 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