Posted: Sat Feb 10, 2007 11:12 pm Post subject: Including Records Based on first,second and third records.
1)I want to include the records in output file based on the contents of first record ,contents of second and third record.The same applies for the next three consecutive records.
Sort usually process record by record.Is there is any way that the sort treates the consecutive three records as a single file?There is no common key for these records in order to make any relationship.I want to make some relationship with the 3 consecutive records.
for the below condition
1)if record 1 matches the condition
2)if record 2 matches the condition
3)if record 3 matches the condition
I want to write all the three records in an ouput file.
For the below condition
1)if record 1 does not matches the condition
2)if record 2 matches the condition
3)if record 3 matches the condition
I don't want to write all the three records to an output file
For the below condition
1)if record 1 matches the condition
2)if record 2 matches the condition
3)if record 3 does not match the condition
I want to write only record 1 and record 2
For the below condition
1)if record 1 matches the condition
2)if record 2 Does not matches the condition
3)if record 3 matches the condition
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Sun Feb 11, 2007 12:06 am Post subject:
vjkumk,
1. What are the conditions to be matched ?
2. Do you always have 3 records? i.e the total no: of records in the input are always a multiple of 3?
3. what is the recfm and lrecl of the file
4. post sample input and desired output
I am in a process of preparing test data for the test cases and i have to extract test data according to the test case.
The input file is an unload file of an IMS database and the RECFM is VB.
2)There will be more records,Yes, the input will be multiple of 3.
3)the RECFM =VB(I am using OPTION VLSHRT NOVLSCMP since it is VB file)
4)Sample input file:
sample Input:(I have inserted the blank lines for clarity,there is no blank line in real).
LT100P100050D287
LT101Z100021DD1
LT101Z100031GG1
LT100P1000670D285
LT101Z100081DD1
LT101Z100021GG1
LT100P100060D287
LT101Z100013GG1
LT101Z100011DD1
LT100P100058D287
LT101Z100021DD1
LT101Z100012DD1
Output:
LT100P100050D287
LT101Z100021DD1
LT100P100060D287
LT101Z100011DD1
LT100P100058D287
LT101Z100021DD1
LT101Z100012DD1
I have mentioned the include conditions below.
1)My input file contains records which starts with LT100 and followed by two LT101 records,the same frequency is repeated.
2)First i have to check the record which starts with LT100 for value 'D287'.
3)If 'D287' matches then i have to check the Next two consecutive records which starts with LT101 for value "DD1".If both the LT101 record matches then i have to write the LT100 and both the LT101 records to the output file.
4)If the VALUE "D287" is not in LT100 record,then I have to skip the LT100 record and next two consecutive records which starts with LT101 and proceed to the 4TH record which is LT100 and check for the same logic mentioned in step 2 and 3.
5)If the value "D287" is in LT100 record and either of the two LT101 record matches the value "DD1",then the LT100 record and the LT101 which is matched has to be written to the output file.
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Sun Feb 11, 2007 10:05 am Post subject:
Try this DFSORT/ICETOOL JCL. Since you did not mention the LRECL of the input file I assumed it to be 84 byes(vb file extra 4 bytes). Brief explanation of the job is that we treat LT100 record as a header record and tag it to all the detail(LT101) records. Once we tag that then it is just an include statement to pick the desired records.
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