Hi,
Can anyone please help me with this problem. I need to delete certain records from the header to the trailer for a particular key. now let me give you an example of the file i have.
This is the format of my file. Now is it possible for me to delete from the header containing key2 till the trailer of the key2 using DFSORT or other utility? if so then can you please tell me how that can be done?
Hi Frank,
Thanks for the link , but when i open it , it says the page was not found can you please look into it and tell me an alternate website where i can get that information?
Hi frank,
The example given in the PDf was just perfect. It worked well for a file with a fixed record length. But when i used the same for a variable length file it did not give the desired results. Is there some change that has to be done to the program inorder for the processing variable length files? If so can you please let me know of that ?
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
You mean RECFM=VB? If so, then yes, you'd have to use a slightly different technique with the sequence number, etc after the RDW instead of at the end of the record.
If you want help with that, show me the statements you used for the RECFM=FB file, and tell me the LRECL of the VB file.
Now what i need to do in this is that i have to remove the records from the first key ie from aaaaaaaaaaaaaa<key> till the report corresponding to that (including the report). The code i have mentioned above does the same but the first report does not get printed in the output. Please let me know how i can solve this also .
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Sorry, but I can't figure out what you want from what you've shown and said.
In your job, you seem to use C'B5326' to find the start of a report and you seem to be including reports with a key of '0404950' or '0288989'. Please show an example of your input records and what you expect for output using the real values like those, so I can see what it is you're trying to do.
Hi Frank,
Sorry for the trouble, In my input the header records are identified by the characters 'B5326' and followed by this is the key to each set of records. So I am using the B5326 to identify my header and the <key> to identify each set of records uniquely. The report that i have specified in the input file is just specified before the start of a header record. The input dataset is as given below.
report.
b5326.a0404950
records for 0404950
records for 0404950
records for 0404950
records for 0404950
records for 0404950
report.
b5326.a0288989
records for 0288989
records for 0288989
records for 0288989
records for 0288989
records for 0288989
records for 0288989
records for 0288989
.........
......
...
In the 35th column is the header identifier 'B5326' in my input , and in the 49th column is the key <0404950>. what is need to do is remove the reocrds from the header i.e 'B5326' till the report coming after the header.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
So "report" represents a set of records?
Quote:
what is need to do is remove the reocrds from the header i.e 'B5326' till the report coming after the header.
For one specific key? Which one? Or is it for more than one specific key? Which ones? Or is it something else?
If your input file looked like this, what should the output file look like?
Code:
report 1.
b5326.a0404950
records for 0404950
records for 0404950
records for 0404950
records for 0404950
records for 0404950
report 2.
b5326.a0288989
records for 0288989
records for 0288989
records for 0288989
records for 0288989
records for 0288989
records for 0288989
records for 0288989
report 3.
...
Hi Frank,
yes the report represents a set of records but the problem with my input file is that the word report is not the uniques identifier to identify a set. For this reason only i am using 'B5326' as an identifier to identify a particular. Please note that the 'B5326' i am using is just to identify the header record. All the header records begin with 'B5326'. There is only one single key ,the number following 'B5326' i.e 0404950
If i were to give the input as you have suggested above and have given an omit condition for the number '0404950' then the output should be as follows.
report 1.
b5326.a0288989
records for 0288989
records for 0288989
records for 0288989
records for 0288989
records for 0288989
records for 0288989
records for 0288989
report 3.
.........
......
...
Hope this clears your doubts. Please let me know if you have any other concerns.
Hi Frank,
Can you please tell me the input file based on which you have created this DFSORT step ? Is the position of each of the characters in the input file vary according to the RECFM ? i.e for VB and FB are the character positions different ?
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
For an FB file, the first data byte starts in position 1.
For a VB file, the RDW is in positions 1-4, so the first data byte starts in position 5.
The DFSORT/ICETOOL job I gave you is based on the VB input file you gave as an example which is what I thought you asked for.
You said
Quote:
In the 35th column is the header identifier 'B5326' in my input , and in the 49th column is the key <0404950>.
I assumed you were not counting the RDW for these starting positions, so I used 39 as the starting position of the header identifer (35+4 for the RDW = 39) and 53 as the starting position for the key (49+4=53).