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
 

 

Converting a binary field into a packed decimal

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

New User


Joined: 14 Aug 2007
Posts: 14
Location: Chennai

PostPosted: Fri Jul 01, 2011 1:23 am    Post subject: Converting a binary field into a packed decimal
Reply with quote

Hi

I have a field which is 9(8) COMP staring from the position 24 in a flat file.

I want to convert that into a packed decimal value S9(15)V9(03) COMP-3 and write the value staring from 73 rd position in my output file.

I used the following statemeny in my sortcard

73:24,4,BI,TO=PD,LENGTH=10,

But the values converted are incorrect.

For eg:

If the 9(8) COMP value is 400 then i received 0.400 in my output file after conversion. But the result must be 400.000 in my output.

Can any one help me to fix this issue?

Thanks & Regards
Santhosh
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jul 01, 2011 2:03 am    Post subject:
Reply with quote

Quote:
i received 0.400 in my output file after conversion.

you lie, you lie, you lie!!!

BI,TO=PD will not generate a decimal point '.' in the output.

probably help if you were to provide:
  • example input with bbcode tags
  • expected output with bbcode tags
  • allllllllll the control cards you are currently using.
then someone can provide better guidance.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Jul 01, 2011 2:42 am    Post subject:
Reply with quote

sthirumalai,

comp fields does not have decimals. so if your intention is to take an absolute value and pad with 3 decimals then you need to multiply it with 1000 and convert it to pd format. Also use FI instead of BI so that you can account for negative numbers also.

Use the following control cards
Code:

73:24,4,FI,MUL,+1000,PD,LENGTH=10, 
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 resume binary ftp in z/os meykh2014 All Other Mainframe Topics 3 Sun Jan 22, 2017 10:01 am
No new posts INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm


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