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
 
character to numeric conversion

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: character to numeric conversion
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    Post subject:
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    Post subject: Reply to: character to numeric conversion
Reply with quote

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

DFSORT Moderator


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

PostPosted: Fri Sep 26, 2008 8:12 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Sat Sep 27, 2008 2:55 am    Post subject:
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    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 File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm
No new posts Select numeric portion from CHAR data... balaji81_k DB2 6 Sat Aug 19, 2017 1:51 am
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm

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