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
Warnings : 2

Senior Member


Joined: 29 Apr 2008
Posts: 1140

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
Warnings : 2

Senior Member


Joined: 29 Apr 2008
Posts: 1140

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: 2723
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

Active Member


Joined: 15 Aug 2015
Posts: 568
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 Getting error S000 U0016 (Cn Internal... JCL & VSAM 4
No new posts using based or defined variables PL/I & Assembler 2
No new posts Is the Output of Sort/Join dependent ... DFSORT/ICETOOL 2
No new posts Trying to use sort to do two function... DFSORT/ICETOOL 14
No new posts Sort to extract lines DFSORT/ICETOOL 8
Search our Forums:

Back to Top