IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Using sort on VB records based on offset value in input


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dbrockman192

New User


Joined: 15 Dec 2020
Posts: 3
Location: United States

PostPosted: Tue Dec 15, 2020 12:37 am
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2019
Location: USA

PostPosted: Tue Dec 15, 2020 2:12 am
Reply with quote

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
View user's profile Send private message
dbrockman192

New User


Joined: 15 Dec 2020
Posts: 3
Location: United States

PostPosted: Tue Dec 15, 2020 2:20 am
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2019
Location: USA

PostPosted: Tue Dec 15, 2020 2:32 am
Reply with quote

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
View user's profile Send private message
dbrockman192

New User


Joined: 15 Dec 2020
Posts: 3
Location: United States

PostPosted: Tue Dec 15, 2020 2:54 am
Reply with quote

Gotcha....

I did just that and it worked.
Thanks! Appreciate the tip!
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Tue Dec 15, 2020 3:37 am
Reply with quote

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
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1246
Location: Bamberg, Germany

PostPosted: Tue Dec 15, 2020 1:50 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top