Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 6968
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 Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm
No new posts Binary to display characters Roy Ware SYNCSORT 3 Tue Sep 19, 2017 8:46 pm
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us