View previous topic :: View next topic
|
Author |
Message |
notonly4u
New User
Joined: 26 Apr 2005 Posts: 87 Location: Hyderabad
|
|
|
|
Dear Friends,
I do have a requirement that I need to have the record length of every record in a VB file in first 2 bytes with the actual record preceeding that, copied to another VB file.
Is this possible in SORT?
Thanks for your time.
Regards
Tanden |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Unless I am mistaken,
The record length is always in the first two bytes of a VB record.
Using sort, the record length is pos 1 len 2 format BI
Or perhaps you want something different ??? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Can you run this and post the sysout from the step in the Code tags, please.
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
Nothing to do with the solution, just for your SORT level
/*
//SORTOUT DD DUMMY
//SYSIN DD *
OPTION COPY
/* |
Also please show a small example input and expected output.
It is not clear exactly what you want. |
|
Back to top |
|
|
Ed Goodman
Active Member
Joined: 08 Jun 2011 Posts: 556 Location: USA
|
|
|
|
Is this for Microfocus load files by any chance?
I have to do the same thing for all of the Filemanager unloads on the mainframe. This is what I use:
Code: |
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL OUTREC=(1,4,1,2,BI,SUB,+2,TO=BI,LENGTH=2,5) |
It takes the first two byes in a VB file, subtracts 2 from that number, then put the answer as the first two "real" bytes int he output record, then it takes the rest of the data and adds it to the output record.
If you don't need to subtract two bytes, then make it like:
Code: |
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL OUTREC=(1,4,1,2,5) |
Code'd |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Yes, Ed. The only difficulty is in exactly what this (emphasis added) means...
Quote: |
I need to have the record length of every record in a VB file in first 2 bytes with the actual record preceeding that |
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Count the actual record bytes with imaginary numbers? |
|
Back to top |
|
|
|