View previous topic :: View next topic
|
Author |
Message |
dbrockman192
New User
Joined: 15 Dec 2020 Posts: 3 Location: United States
|
|
|
|
Hi - I am not sure if this is possible using sort....
But i have a VB input file. The first byte (after the RDW) is a header length (hex length=1) field followed by header information, then record detail info.
I'd like to extract that length value to bump past that header information and only put the detail data in my output file.
Does this sound possible using sort?
I've tried using parse...but it doesn't seem like the parse variable can be used as the starting position in my OUTFIL.
Example
Code: |
Infile
n12345John Smith where n=x'05'
n123Betty Jones where n=x'03' |
Code: |
Outfile
John Smith
Betty Jones |
Output file should stay as VB.
Code'd for you |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2019 Location: USA
|
|
|
|
Code: |
INREC IFTHEN=(WHEN=(5,1,BI,EQ,+1),BUILD=(1,4,6)),
IFTHEN=(WHEN=(5,1,BI,EQ,+2),BUILD=(1,4,7)),
IFTHEN=(WHEN=(5,1,BI,EQ,+3),BUILD=(1,4,8)),
. . . . . . .
IFTHEN=(WHEN=(5,1,BI,EQ,+100),BUILD=(1,4,105))
|
|
|
Back to top |
|
|
dbrockman192
New User
Joined: 15 Dec 2020 Posts: 3 Location: United States
|
|
|
|
Thanks sergeyken....
because the field is xl1 for the offset...you are suggesting 255 "IFTHEN's?
That would def work...
I was hoping I could read that XL1 offset value into a variable similar to options available with the PARSE and then somehow use it as the start position in the outfil. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2019 Location: USA
|
|
|
|
dbrockman192 wrote: |
Thanks sergeyken....
because the field is xl1 for the offset...you are suggesting 255 "IFTHEN's?
That would def work...
I was hoping I could read that XL1 offset value into a variable similar to options available with the PARSE and then somehow use it as the start position in the outfil. |
1. This is a typical result of stupid initial design of data formats.
2. It is not a big deal to create 255 typical lines for the control statement. Either manually in ISPF editor, or “automatically” using one of multiple available tools, from REXX to SORT utility itself. |
|
Back to top |
|
|
dbrockman192
New User
Joined: 15 Dec 2020 Posts: 3 Location: United States
|
|
|
|
Gotcha....
I did just that and it worked.
Thanks! Appreciate the tip! |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
Or you could just copy it and replace initial 1-5 after RDW numbers by spaces and sqz it to the left, at this point it doesn't matter from where it starts. |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1246 Location: Bamberg, Germany
|
|
|
|
Rohit Umarjikar wrote: |
Or you could just copy it and replace initial 1-5 after RDW numbers by spaces and sqz it to the left, at this point it doesn't matter from where it starts. |
That would possibly alter the record detail info. |
|
Back to top |
|
|
|