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

Moving Numeric Values to Alphanumeric variable


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Apr 25, 2014 2:44 pm
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: 6966
Location: porcelain throne

PostPosted: Fri Apr 25, 2014 4:08 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
Search our Forums:

Back to Top