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

character to numeric conversion


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sriramvempaty

New User


Joined: 02 Aug 2007
Posts: 18
Location: india

PostPosted: Fri Sep 26, 2008 8:00 pm
Reply with quote

Hi,

I have a file which has numeric data in three parts of file present in character format.

1 to 10 bytes,
20 to 32 bytes,
52 to 54 bytes.

My record length is 60 bytes.

How can i convert those characters to numeric?

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

New User


Joined: 18 Oct 2006
Posts: 73

PostPosted: Fri Sep 26, 2008 8:01 pm
Reply with quote

What do you mean by numeric??

you mean PD (packed decimal)
Back to top
View user's profile Send private message
sriramvempaty

New User


Joined: 02 Aug 2007
Posts: 18
Location: india

PostPosted: Fri Sep 26, 2008 8:02 pm
Reply with quote

Simply from CH to ZD format.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Sep 26, 2008 8:12 pm
Reply with quote

Quote:
How can i convert those characters to numeric?


It depends on what your data looks like. For example, a 10-byte character field of:

1234567890

is already in ZD format, whereas a 10-byte value of:

-123456789

is not.

So you need to show an example of the records in your input file and what you expect for output. If your input data is not displayable, show it in hex.
Back to top
View user's profile Send private message
hchinnam

New User


Joined: 18 Oct 2006
Posts: 73

PostPosted: Fri Sep 26, 2008 8:33 pm
Reply with quote

Quote:


For example, a 10-byte character field of:

1234567890

is already in ZD format



Frank, I thought 1234567890 in ZD looks like line 2 or 3 in the code below (depending on positive or negetive). Where as in CH format it looks like line 1. Is it not the case?

Code:


000001 1234567890   
       FFFFFFFFFF4444
       12345678900000
---------------------
000002 123456789{   
       FFFFFFFFFC4444
       12345678900000
---------------------
000003 123456789}   
       FFFFFFFFFD4444
       12345678900000
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Sat Sep 27, 2008 2:55 am
Reply with quote

Line1 is a valid positive ZD value using an F sign (and also a CH value). Line2 is a valid positive ZD value using a C sign. Line3 is a valid negative ZD value using a D sign.

F and C are both valid ZD signs.

The real question here is what the OP's CH input values look like. If, in addition, he wants his positive ZD output values to have a particular sign (F or C) for some reason (some applications require one or the other), he can tell us that.
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 10 byte RBA conversion DB2 2
No new posts 10 byte RBA conversion -non applicati... JCL & VSAM 1
No new posts file manager is doing string conversion IBM Tools 3
No new posts Convert HEX to Numeric DB2 3
No new posts Panvalet - 9 Character name - Issue c... CA Products 6
Search our Forums:

Back to Top