I'm actually trying to extract certain fileds from each record of an Input file which has header, Body and the trailor record.
Im using the Outrec functionality to do this, which is working pretty much fine....
The problem is, The output record should contain the fields extracted from the input record, but along with that I also need a field from the header record to be appended at the end of each record...
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Can you look at the output messages from any old sort job that you have lying around, and just let us know what they start with. Even better, do you (reliably) know which sort product you have?
Won't make a big different to the solution, but you might be in the right, or the wrong, forum. Just checking.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Yes, this is impossible to do with JCL.
It is possible with SORT, but SORT isn't JCL. SORT is a program. JCL runs programs and attaches the resources a program needs to the actually existing bits lying around here and there.
If you are just patient and nice, one of the SORT Wizards will probably come up with something for you.
If you are impatient, you may have to look elsewhere.
While waiting, how about digging up a manual and having a look yourself? Good way to pick up something along the way.
Thanks Bill.... ya i am doing it.... Ll try something else would write a cobol program to accomplish it.... or an Easytrieve program in the jcl SYSIN might also work.... not sure....
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
narasimha.g,
Here's a Syncsort job which would work for the example given.
I have assumed 'UHL' at pos-1 for the header record and that you do not need the header to be written into the output as shown in your example. The below sort assumes the input to be of FB/LRECL=80 and can be modified as per your real file attributes
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
narasimha.g,
You excluded the header (and trailer) in your sample output. You should be able to cope with excluding the trailer from the cards shown, and to include both without amendments if that is what you actually want.
Here's a Syncsort job which would work for the example given.
I have assumed 'UHL' at pos-1 for the header record and that you do not need the header to be written into the output as shown in your example. The below sort assumes the input to be of FB/LRECL=80 and can be modified as per your real file attributes
And what do you want in the remaining bytes up to 82?
Is the file VB are FB?
What do you have as your SORTOUT?
The example which i gave there was just a sample.... i have an input of lenght 100... i would be seleting more fields than i mentioned before..... but at end i need the field from the header to be appended.....
It is a FB file... and my SORTOUT is a FB dataset LRECL 82