MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Changing the sign byte and assumed decimal to char

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
ssanthosh
Beginner


Joined: 19 Mar 2007
Posts: 13
Topics: 5

PostPosted: Thu Nov 13, 2008 4:47 pm    Post subject: Changing the sign byte and assumed decimal to char Reply with quote

We have a dataset where the signed byte is declared as S9(13)V9(02). When we ftp this file to windows server the data is not in readable format.
Our aim is to convert the Amount field S9(13)V9(02) to character format X(13).X(2) and then ftp to the server. Is there anyway to we can do this using SORT. I tried ICETOOL but could not get the expected result. The amount field appears starting from 895the position in the input file.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Thu Nov 13, 2008 5:02 pm    Post subject: Reply with quote

ssanthosh,

A Field defined as S9(13)V9(02) is a 15 byte zoned decimal field with the sign punched on the last byte

Code:

{ABCDEFGHI}JKLMNOPQR
CCCCCCCCCCDDDDDDDDDD
01234567890123456789


Hex C0 thru C9 are positive numbers and D0 thru D9 are negative numbers.

You can change S9(13)V9(02) to X(13).X(2) , but you also need another byte to differentiate between positive and negative numbers. So the total number of digits will be 17 if you want all the 13 + 2 digits of the number. If you think the number wont exceed 11+2 digits then you can convert it to SX(11).X(2), You can use the following control cards. P stands for the position where your numeric field starts

Code:

 OUTREC OVERLAY=(P:P,15,ZD,EDIT=(STTTTTTTTTTT.TT),SIGNS=(+,-))


Hope this helps...

Cheers
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ssanthosh
Beginner


Joined: 19 Mar 2007
Posts: 13
Topics: 5

PostPosted: Fri Nov 14, 2008 10:10 am    Post subject: Reply with quote

Thank you kolusu. It worked.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group