Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 7315

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: 6968
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 Select numeric portion from CHAR data... balaji81_k DB2 1 Sat Aug 19, 2017 1:51 am
No new posts Move from Comp3 variable to Edited Va... sreekusr COBOL Programming 8 Thu Aug 10, 2017 4:20 pm
No new posts BI,TO=ZD Changing Values Tyler Dunbar DFSORT/ICETOOL 4 Tue Jul 25, 2017 12:12 am
No new posts Validate if a Value from the file is ... balacsv2 COBOL Programming 8 Mon Jun 19, 2017 11:52 pm
No new posts Can I traverse a STEM variable? chong.zhou CLIST & REXX 5 Wed May 31, 2017 3:54 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us