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

Coverting PD to FS and also left justifying the value.


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

New User


Joined: 08 Aug 2011
Posts: 7
Location: India

PostPosted: Wed Aug 24, 2016 4:31 pm
Reply with quote

Hi,

I have a requirement to copy value from field1 (defined as 9(7) COMP3) to another field2 (defined as X(12)) in the same record. Additionally, the target field i.e. field2 should be left justified.

I have written a DFSORT to copy the value from field1 to field2 by converting it from PD to FS and SQZ operation to left justify is giving syntax error.

OUTFIL FNAMES=OUTDATA1
IFTHEN=(WHEN=(16,6,CH,EQ,C'111111'),
OVERLAY=(1634:3672,4,PD,TO=FS,SQZ=(SHIFT=LEFT,LENGTH=12))),

IFTHEN=(WHEN=NONE,
BUILD=(1,3800))

The input record is fixed byte 3800.
Field1 is at Pos 1634, length 12
Field2 is at Pos 3672, length 4

For example if the value in the field2 is 290 (FS value after conversion) then it should be populated in field1 as 290bbbbbbbbb where b is spaces.

Can you please assist me how I can achieve this in single ICETOOL step?

Thanks,
Atul
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: Wed Aug 24, 2016 7:08 pm
Reply with quote

Don't use FS use an EDIT with a zero-suppression mask.
Back to top
View user's profile Send private message
magesh23586

Active User


Joined: 06 Jul 2009
Posts: 213
Location: Chennai

PostPosted: Thu Aug 25, 2016 2:37 am
Reply with quote

You missed one comma after FNAMES and as per Bill advise, use EDIT.

use the below code and let us know the output.

Code:

OUTFIL FNAMES=OUTDATA1,
       IFTHEN=(WHEN=(16,6,CH,EQ,C'111111'),
       OVERLAY=(1634:3672,4,PD,EDIT=(IIIIIIIIIIIT),
                1634:1634,12,SQZ=(SHIFT=LEFT))),
       IFTHEN=(WHEN=NONE,BUILD=(1,3800))
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 Aug 25, 2016 2:42 am
Reply with quote

There's no need for the BUILD.
Back to top
View user's profile Send private message
magesh23586

Active User


Joined: 06 Jul 2009
Posts: 213
Location: Chennai

PostPosted: Thu Aug 25, 2016 2:47 am
Reply with quote

Bill,

True, not required.
Back to top
View user's profile Send private message
Atul Banke

New User


Joined: 08 Aug 2011
Posts: 7
Location: India

PostPosted: Fri Aug 26, 2016 12:08 pm
Reply with quote

Thanks a lot Bill, Magesh -

This solution worked perfectly fine.

I am using BUILD for the other records as the overlay is required for specific records and the other records needs to be copied as it is.

Thanks again!


Regards,
Atul
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 Aug 26, 2016 2:26 pm
Reply with quote

No you are not using BUILD for that. You are using BUILD to copy each of the 3800 bytes on each record not satisfying the IFTHEN to itself so that each byte has its original value before the BUILD, but CPU is consumed.

You may want to ask your client if they want to actually pay for nothing discernible to happen, and you may want to review existing code to make sure the same thing is not done elsewhere.
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 Quantifying/Justifying CPU savings All Other Mainframe Topics 2
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
No new posts Squeeze record left so that zeroes ar... SYNCSORT 5
No new posts Zero suppress and shift left DFSORT/ICETOOL 10
No new posts Justifying Count Value On Trailer DFSORT/ICETOOL 6
Search our Forums:

Back to Top