Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Converstion of Char to PD

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Sikkandhar

New User


Joined: 03 Dec 2007
Posts: 58
Location: Bangalore

PostPosted: Fri Apr 18, 2014 12:38 am    Post subject: Converstion of Char to PD
Reply with quote

Hi,

I have a number populated in X(17). Have to convert to X(17) to S9(13)V9(5) COMP -3. I used the below command

Code:

1:1000,17,ZD,TO=PDC,LENGTH=10,   


The charector field starts from position 1000 and occupies 17 bytes. The last 4 bytes in X(17) are the decimal field.
When the value is Charector field is '00000000010000000', the value populated is 100.00000 instead of 1000.0000.

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

Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1789
Location: Bloomington, IL

PostPosted: Fri Apr 18, 2014 1:08 am    Post subject:
Reply with quote

Are you saying that the least significant digit of the packed decimal field should always be set to zero?
Back to top
View user's profile Send private message
Sikkandhar

New User


Joined: 03 Dec 2007
Posts: 58
Location: Bangalore

PostPosted: Fri Apr 18, 2014 1:11 am    Post subject:
Reply with quote

yes. the least significant bit/5th decimal field should be set to zero.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1789
Location: Bloomington, IL

PostPosted: Fri Apr 18, 2014 1:48 am    Post subject:
Reply with quote

Remember that in a packed decimal field there is no indication of the decimal point; you have to know where it is and code accordingly (in assembler), or define your variables to tell the compiler where it is.

(Remember also that COBOL terminology should only be used to describe COBOL problems.)

A simple way to get what you want is
Code:
1:1000,17,ZD,MUL,+10,TO=PDC,LENGTH=10
Back to top
View user's profile Send private message
Sikkandhar

New User


Joined: 03 Dec 2007
Posts: 58
Location: Bangalore

PostPosted: Fri Apr 18, 2014 2:02 am    Post subject:
Reply with quote

Thanks Akatsukami. Thanks for you solution it worked and it was simpler than the one i thought of. To use INREC and pad an extra zero to the 17 byte Char.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts how to convert Hex String t char hex Martylin PL/I & Assembler 6 Fri Jun 05, 2020 7:45 pm
No new posts Insert System Runtime in HEADER In SY... Rick Ryan SYNCSORT 9 Tue May 26, 2020 9:01 pm
No new posts how to do bit operations from CHAR Martylin PL/I & Assembler 3 Wed May 13, 2020 8:27 pm
No new posts comparasion between BIN FIXED(63) an... javen777 PL/I & Assembler 10 Wed Apr 22, 2020 5:11 pm
No new posts Code char set conversion from IBM-420... thelefthandofdarkness IBM Tools 4 Thu Jul 26, 2018 3:03 pm

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