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
 

 

Coverting PD to FS and also left justifying the value.

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

New User


Joined: 08 Aug 2011
Posts: 5
Location: India

PostPosted: Wed Aug 24, 2016 4:31 pm    Post subject: Coverting PD to FS and also left justifying the value.
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Aug 24, 2016 7:08 pm    Post subject: Reply to: Coverting PD to FS and also left justifying the value.
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: 158
Location: Chennai

PostPosted: Thu Aug 25, 2016 2:37 am    Post subject: Reply to: Coverting PD to FS and also left justifying the value.
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Aug 25, 2016 2:42 am    Post subject: Reply to: Coverting PD to FS and also left justifying the value.
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: 158
Location: Chennai

PostPosted: Thu Aug 25, 2016 2:47 am    Post subject: Reply to: Coverting PD to FS and also left justifying the value.
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: 5
Location: India

PostPosted: Fri Aug 26, 2016 12:08 pm    Post subject: Reply to: Coverting PD to FS and also left justifying the value.
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Aug 26, 2016 2:26 pm    Post subject: Reply to: Coverting PD to FS and also left justifying the value.
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    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 Zero suppress and shift left Bryant Shearin DFSORT/ICETOOL 10 Sat Oct 31, 2015 9:28 pm
No new posts Justifying Count Value On Trailer shajeeth DFSORT/ICETOOL 6 Tue Nov 18, 2014 9:32 pm
No new posts Cut leading spaces or others and just... Auryn COBOL Programming 4 Fri Oct 25, 2013 7:23 pm
No new posts SQZ=(SHIFT=LEFT) with IFTHEN karthik_sripal DFSORT/ICETOOL 2 Tue Jul 09, 2013 12:32 am
No new posts 3 table left outer join query Bill Woodger DB2 13 Thu Jan 10, 2013 5:04 pm


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