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 Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm
No new posts Move from Comp3 variable to Edited Va... Revathy.nair0485 COBOL Programming 7 Fri Nov 03, 2017 3:30 pm
This topic is locked: you cannot edit posts or make replies. Can a alphanumeric data be moved to a... nico_neoz COBOL Programming 10 Mon Oct 30, 2017 8:28 am
No new posts Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts Moving UDB database to Db2 on z/OS Keith Hooley DB2 4 Wed Sep 27, 2017 12:38 am

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