Would any one please suggest a solution for the below requirement.
We have to extract only header (1st record) and trailer (last record) from a file, but we dont have any specific indicator to know the record type i.e. header/detail/trailer.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Kranti,
You can use a DFSORT job like the one below to do what you asked for. I assumed your input file has RECF=FB and LRECL=80, but the job can be changed appropriately for other attributes.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Upendra,
You used HEADER instead of HEADER1 and TRAILER instead of TRAILER1.
But you didn't say your records were 5818 bytes. The method I showed will only work for up to 256 bytes. To get 5818 bytes, you'd need to use 23 p,m fields which is probably not practical.
Instead, you can use a DFSORT/ICETOOL job like the following:
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
my input file is VB with lrecl=5818 and i want to convert it into FB and copy only first and last records
Why didn't you say that in your first post? It makes a big difference.
If your input file is VB/5818 and you want to convert it to FB, you wouldn't want the RDW in the FB records, so the output length would be 5814, not 5818. Here's a DFSORT/ICETOOL job to do it.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
You can now do this more easily and efficiently using the new SUBSET operator of DFSORT's ICETOOL available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008) like this: