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

Converting a binary field into a packed decimal


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
No new posts Def PD not working for unsigned packe... JCL & VSAM 3
Search our Forums:

Back to Top