I have a ps file. Due to a problem in ftp the contents of the file are reversed. Now I want manipulate this file to get the original contents with the help of jcls. Can you help me?
Could you be a little more specific about your problem? Do you mean the file contents are just in reverse sort order (last record appearing at the top)?
If the contents of your file are simply appearing upside down, then you could probably sort them in the reverse order, provided the file has a sort key.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
If the contents of your file are simply appearing upside down, then you could probably sort them in the reverse order, provided the file has a sort key.
And if records don't have a key, you can add a sequence number to each record with DFSORT's INREC statement, sort the records descending on the sequence number with DFSORT's SORT statement, and then remove the sequence numbers with DFSORT's OUTREC statement.
do to problem in FTP the output file now is in following format
record length-80
contains 50 records
but each record has been reversed. for eg
before FTP the value present in 1st byte is now present in 80th byte after FTP.
similarly value at 2nd byte is now present in 79th byte after FTP and so on.
how can i get back the original format. can it be done through JCL.
It may not be so easy to reverse the data in the record simply by the use of JCL. Other forum users may have ideas.
I believe you will have to use some programming language (REXX may work best) to fix your problem.
Being an assembler developer, I can think of the MVCIN instruction for reversing the order of the bytes of a string or a record. I think I am getting carried away from the subject here.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
But in a VB file, the records may be of different lengths. And the OUTREC statement you've suggested assumes that the input record length is 80.
Yes, that's what I assumed since you didn't say otherwise. For a true VB file, you'd need to use IFTHEN to set up a different BUILD for each record length, e.g.