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

Overlay with right shift


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

Active User


Joined: 02 Jan 2009
Posts: 115
Location: Hyderabad

PostPosted: Thu Jan 28, 2016 7:49 pm
Reply with quote

Hello,

I have the below vb file

Code:

01101BBBBBCCCCCCCCCCEEEEEEEEEEEEEEEEEEEE


First 5 bytes are flags and next set is data related to the flags. If a flag is set to 0, there will not be any detailed information. Say Flags A thru E. Detailed info length of flags A thru E are 3,5,10,15,20 bytes respectively.

Now, I have an assembler program to expand this input file based on flags and filling the information with spaces when flag is set to 0.

Output would be
Code:

01101   BBBBBCCCCCCCCCC               EEEEEEEEEEEEEEEEEEEE

Can this be done using DFSORT?

I am thinking this way - inrec if 1st byte is 0, overlay 6:3x with right shift (I had findrep right shift in mind). And so on... with hit=next and other conditions. Later I realized there is nothing like right shift for overlay.
Even if we have a way to right shift the data while inserting, does the next ifthen take the latest inrec updated by previous ifthen?

I could have gone for different combinations of these flags and writing inrec overlay. But the flags are more in number (15 flags).

Please advise if there is a way to do. I searched the forum for key words "insert shift", "right shift" etc. But only found right shift for sqz and findrep.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Jan 28, 2016 9:05 pm
Reply with quote

You missed finding JFY.

However, JFY won't do what you want.

If you have 15 flags, you'll need 15 IFTHEN=(WHEN=(logicalexpression) each (except the last) with HIT=NEXT.

You won't be able to use OVERLAY, because it works directly on the existing current record. You will trash your data in no time. BUILD always creates a new current message, so you'd need BUILD.

Doing up to 15 BUILDs has some overhead per record has some overhead. If you have a lot of data to do this to, you may want to knock together a quick E15 or E35 sort exit (examples in the manual) as well, and compare the two.
Back to top
View user's profile Send private message
kranthikumarb

Active User


Joined: 02 Jan 2009
Posts: 115
Location: Hyderabad

PostPosted: Fri Jan 29, 2016 10:31 am
Reply with quote

Thanks for the idea Bill. I have millions of records to be processed. So do you think 15 builds is not good idea? That is why I was looking for a non existing syntax overlay with right shift icon_biggrin.gif

Here is the code with your idea

Code:

//SORT1    EXEC PGM=SORT                                               
//SORTIN   DD   *                                                     
01101BBBBBCCCCCCCCCCEEEEEEEEEEEEEEEEEEEE                               
/*                                                                     
//OUT  DD   SYSOUT=*                                                   
//SYSOUT DD SYSOUT=*                                                   
//SORTOUT DD SYSOUT=*                                                 
//SYSIN    DD   *                                                     
 SORT FIELDS=COPY                                                     
 INREC IFTHEN=(WHEN=(1,1,CH,EQ,C'0'),BUILD(1,5,6:3X,6,50),HIT=NEXT),   
     IFTHEN=(WHEN=(2,1,CH,EQ,C'0'),BUILD(1,8,9:5X,9,50),HIT=NEXT),     
     IFTHEN=(WHEN=(3,1,CH,EQ,C'0'),BUILD(1,13,14:10X,14,50),HIT=NEXT),
     IFTHEN=(WHEN=(4,1,CH,EQ,C'0'),BUILD(1,23,24:15X,24,50),HIT=NEXT),
     IFTHEN=(WHEN=(5,1,CH,EQ,C'0'),BUILD(1,38,39:20X))                 
                                                                       
/*                                                                     



Output
Code:

01101   BBBBBCCCCCCCCCC               EEEEEEEEEEEEEEEEEEEE
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Jan 29, 2016 12:51 pm
Reply with quote

With OVERLAY you have to watch out for destroying your data. If you tried OVERLAY=(1,5,6:3X,6,50) you'd junk the data (give it a try with some test data).

However, use JFY with SHIFT=RIGHT for the data other than the first 5/15. Now your data is in a fixed position for inserting the blanks working from right-to-left.

You must, as in must, relocate the data first, and then do the blanks. If you do the blanks fist, you'll again destroy data.

That should improve things over the BUILDs you have already. The BUILDs are still useful, as running one on your test-data confirms that the other works (or doesn't).
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 Shift left VB record without x00 endi... DFSORT/ICETOOL 11
No new posts Help, trying to use OVERLAY to get a ... DFSORT/ICETOOL 3
No new posts BNDS and Overlay command TSO/ISPF 9
No new posts Issues with outrec overlay while extr... SYNCSORT 7
No new posts HOW TO OVERLAY A Packed decimal VALUE... DFSORT/ICETOOL 5
Search our Forums:

Back to Top