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
 
Moving Numeric Values to Alphanumeric variable

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
View previous topic :: :: View next topic  
Author Message
rokes

New User


Joined: 09 Jan 2014
Posts: 7
Location: India

PostPosted: Fri Apr 25, 2014 1:30 pm    Post subject: Moving Numeric Values to Alphanumeric variable
Reply with quote

Hello,

I am trying to pass a Numeric field to an Alphanumeric field and write in output file. Its getting printed without the decimal point.


For eg. Amount = 175.50

I tried,


Code:
Amount          W  6 N 2
Price-Value     W  8 A

Price-Value = Amount
PUT OUTFILE



In the output file
it is printed as

Code:
00017550


I need to print it as it is. i.e,

Code:
 175.50


1. I cannot define the output variable as N because I need to pass the column name via same variable in the output file.

2. I had tried defining two separate variable structure for heading and then the values. But since the structure name is defined as alphanumeric, it still prints without any decimal point.

3. I cannot use the REPORT option because i have other constraints in comparing this output file with other files.

Please provide any help.

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

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7314

PostPosted: Fri Apr 25, 2014 2:44 pm    Post subject: Reply to: Moving Numeric Values to Alphanumeric variable
Reply with quote

You'll have to explain 1), 2) and 3) with examples.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

PostPosted: Fri Apr 25, 2014 4:08 pm    Post subject:
Reply with quote

well first of all, you have to realize that nnnnnnnnnnoooooooooo numeric type field has the decimal point.

it is implied.

if this were true: Mainframe Skills: Rexx/Cobol/Jcl/PL1/Eztrieve/DB2
you would have known that.

since your profile overstates your skills,
I will provide you an answer that actually belongs in the students' forum (as I think you do)
suggest you look for something called an 'edit mask'.
either that or you must redefine price value (needs to be W 9 A
into 3 fields
Code:

1st): Non-decimal-amount    W 6 N 0
2nd): decimal-point         W 1 A      (value '.' or move a '.' to decimal-point)
3rd): decimal-amount        w 2 N 2


and then code:
Code:

Non-decimal-amount = Amount
decimal-point      = '.'
decimal-amount     = Amount
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 -> CA Products All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How can we create a flat file in JAVA... jasorn Java & MQSeries 2 Wed Aug 08, 2018 3:08 pm
This topic is locked: you cannot edit posts or make replies. I need to remove low values in my field shymala COBOL Programming 8 Sun Jul 29, 2018 11:15 am
No new posts AFP duplex page containing variable data jose angel santamaria IBM Tools 0 Wed Jul 18, 2018 12:35 pm
No new posts KSDS file fields update by passing va... Anil Kumar Prajapati TSO/ISPF 5 Wed Jul 11, 2018 5:59 am
No new posts LOW VALUES as a KEY juares castro DB2 10 Sat Apr 07, 2018 1:06 am

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