I have a requirement. I want to select the next record depending upon a criteria. Ex: In Ist record If 0401 is present in position 60 then I want to select next record as well as that record.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Please explain in more detail what you want, and show a more complete example of the records in the input data set and what you want for output. Are you only trying to select one pair of records or more than one pair? Based on one condition for all of the pairs or different conditions for each pair? What is the RECFM and LRECL of the input file?
25kL01 000000 V PHARMACY E
25 0501609864808000400000000500111111 V 0000 000000000000Y
25kL01 000000 V PHARMACY E
25 0501609864808000400000000500222222 V 0000 000000000000Y
Here I want to pick up where PHARMACY E is there and 111111 is also present. Dependin upon this criteria I want to pick up as many pairs are present in the dataset.
Hi Suzeet. I presume that the string U have gievn in the example is 1 string which has got splitted in 2 lines. If this holds true then what U can do read the String into some Temp. String which U can define in in WS.
Then using Reference Modification(for the WS string) Read PHARMACY E & 111111 in two diff. strings(Define in WS). Now read the next record & using refernce modification match the string, where ever U find the match write that record to some file & repeat the same for all teh records U read.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Suzeet,
If you have z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006), you can use this one-pass DFSORT/ICETOOL job to do what you asked for:
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Ok. Glad I could help. I'd suggest asking your System Programmer to install the April, 2006 DFSORT PTF so you can use all of the latest DFSORT functions.
With suzeet's dataset I have an almost simillar requirement.
I want to replace some fields in the dataset itself. Suppose following is the input file
25kL01 000000 V PHARMACY E 25 0501609864808000400000000500111111 V 0000 000000000000Y
25kL01 000000 V PHARMACY E
25 0501609864808000400000000500222222 V 0000 000000000000Y
In the above dataset where PHARMACY is present and 111111 is present I want to change the dataset two characters to C'00'.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
In the above dataset where PHARMACY is present and 111111 is present I want to change the dataset two characters to C'00'.
Huh? What does "I want to change the dataset two characters to C'00'" mean? Which two characters? And do you want to change it when 'PHARMACY' is present or when 'PHARMACY E' is present? It would have helped if you showed a more complete example of possible input records, and it definitely would have helped if you'd showed the expected output records.
25kL01 000000 V PHARMACY E
25 0501609864808000400000000500111111 V 0000 000000000000Y
25kL01 000000 V PHARMACY E
25 0501609864808000400000000500222222 V 0000 000000000000Y
25kL01 000000 V PHARMACY E
25 0501609864808000400000000500111111 V 0000 000000000000Y
25kL01 000000 V PHARMACY E
25 0501609864808000400000000500333333 V 0000 000000000000Y
I want where PHARMACY E and in the next record 111111 are present change first two characters of second record of the pair to 00
My output dataset should look like this
25kL01 000000 V PHARMACY E
00 0501609864808000400000000500111111 V 0000 000000000000Y
25kL01 000000 V PHARMACY E
25 0501609864808000400000000500222222 V 0000 000000000000Y
25kL01 000000 V PHARMACY E
00 0501609864808000400000000500111111 V 0000 000000000000Y
25kL01 000000 V PHARMACY E
25 0501609864808000400000000500333333 V 0000 000000000000Y
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
New2mf,
If you have z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006), you can use this one-pass DFSORT/ICETOOL job to do what you asked for: