Joined: 11 Jan 2010 Posts: 13 Location: chennai/hyderabad
Hi,
I have one question,If some gets some time please help..
1st Example:
I have an input file namely EMP-IN & output EMP-OUT which is (FB, LRECL=80) respectively
EMP-IN
----------------------------------------------------
ESUOHG ENAID
OTLA NELLA
----------------------------------------------------
I want the above Input as below output
EMP-OUT
-----------------------------------------------------
ALLEN ALTO
DIANE GHOUSE
-----------------------------------------------------
Condition :
Last letter of the input file is getting reserved to 1st letter in the output file..(i.e OTLA NELLA (input) to ALLEN ALTO(output). Similary till the end of the string..
Can we do this using DFSORT?
I am referring to the DFSORT material to findout.. Meanwhile if possible help me out..
Joined: 11 Jan 2010 Posts: 13 Location: chennai/hyderabad
Hi Greey,
Thank you very much.
The JCL provided by you is working very fine.. But I am sorry if my requirement is not clear to you..
If you see the input file
EMP-IN
----------------------------------------------------
ESUOHG ENAID
OTLA NELLA
----------------------------------------------------
And I wanted the output file as
-----------------------------
ALLEN ALTO - this was the last record in the input file
DIANE GHOUSE - First record of the input file
---------------------------
So The jcl shoudl reverse the letter as well as the Last record should come as 1st record in the output and next last record should be 2nd and so on till EOF.
Once again I am sorry if i am not clear with the explanation.
Joined: 11 Jan 2010 Posts: 13 Location: chennai/hyderabad
Hi,
Thanks a lot,
I have one doubt/question..Why do we give (SORT FIELDS=(81,8,ZD,D)) 81 position as the file is having only LRECL as 80? Any reason? always I seen them in Overlay as well INREC OVERLAY=(81:SEQNUM,8,ZD))
Sorry if this question is silly.. bt wanted to know..
Thanks Skolusu.. Even i corrected when i use that JCL given by Greey,
I have found one more way to copy the records, Hope it helps some one
Why do we give (SORT FIELDS=(81,8,ZD,D)) 81 position as the file is having only LRECL as 80? Any reason? always I seen them in Overlay as well INREC OVERLAY=(81:SEQNUM,8,ZD))
This means that the sort utility writes an 8 byte sequence number at position 81 of the output record. Your file has lrecl=80 but sort workspace has more.
This 8 byte sequence number is nothing but a number nnnnnnnn in Zoned Decimal format. Once sort has added sequence number to all the records, this sequence number can then be used for sorting the dataset in an order based on this very sequence number.
Try OVERLAY=(71:SEQNUM,8,ZD) with the same file and see what's the output. You will get a better understanding of this.
This is FileAid called from batch. Depends on whether an installation has File-Aid.
Why to break a simple task in 2 steps and both the steps have different utilities running!! As Garry said, the overall thing can be done in a single step. And I feel that will be better from a maintenance point of view.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
ragbose wrote:
I have found one more way to copy the records, Hope it helps some one
I don't think it is going to be of any help to anyone when your file-aid control cards are limiting the output to just 2 records. what happens if your input has more than 2 records like this? Are you going to change the control cards every time you have variable number of records?
Code:
//SORTIN DD *
ESUOHG ENAID
OTLA NELLA
ESOBGAR
REGEAY KNARF
TROSFD
MBI
On the other hand I don't see a need/reason to use another utility to read the file once again when you can do everything you want in a single pass of data.
Joined: 11 Jan 2010 Posts: 13 Location: chennai/hyderabad
Hi All,
Ya Skolusu You are correct..I checked the forum once after I got the other way to copy the record from back... So I posted the solution I used to satisfy the requirement and later Once I see your solution I incorporated according to you..