Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Overlay with right shift

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
kranthikumarb

Active User


Joined: 02 Jan 2009
Posts: 114
Location: Hyderabad

PostPosted: Thu Jan 28, 2016 7:49 pm    Post subject: Overlay with right shift
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Thu Jan 28, 2016 9:05 pm    Post subject:
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: 114
Location: Hyderabad

PostPosted: Fri Jan 29, 2016 10:31 am    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Fri Jan 29, 2016 12:51 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts technology shift from Mainfame to AS400 Prayag P V All Other Mainframe Topics 3 Tue Jul 19, 2016 12:13 pm
This topic is locked: you cannot edit posts or make replies. BBC is seeking a Security Operations ... Express Mainframe Jobs 0 Tue Dec 22, 2015 1:20 am
No new posts Zero suppress and shift left Bryant Shearin DFSORT/ICETOOL 10 Sat Oct 31, 2015 9:28 pm
No new posts Overlay with WHEN=Group not working krsenthil85 DFSORT/ICETOOL 7 Wed Oct 21, 2015 4:00 am
No new posts Merge two files with some replace/ove... dheeraj.ramchandani DFSORT/ICETOOL 10 Thu Sep 03, 2015 7:59 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us