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
 
Decimal field not displaying properly in output file

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

New User


Joined: 23 Jan 2007
Posts: 12
Location: India

PostPosted: Tue Apr 17, 2007 4:04 pm    Post subject: Decimal field not displaying properly in output file
Reply with quote

Hi all,



I am writing an Easytrieve program to read a sequential file modify some values and then write into a different sequential file.



I have defined a numeric field for the output file as follows:

O-GROSS-LN-AMT * 11 N 2



I am moving the value of the corresponding input field I-GROSS-LN-AMT to O-GROSS-LN-AMT. When I display the value of O-GROSS-LN-AMT it displays the correct value with decimal point but when I write this field into the output file then the decimal point is missing.



For e.g.:-



Suppose I-GROSS-LN-AMT has the value 10000.00. When I display O-GROSS-LN-AMT it display the value 10000.00 but the corresponding value for the field in the output file is 00001000000.



Could some one help me out with this?
Back to top
View user's profile Send private message

murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Tue Apr 17, 2007 4:40 pm    Post subject:
Reply with quote

Sharath,

'.' is a print mask (assumed decimal point. i.e., equivalent of V in cobol). It will not be stored in the OP file.
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Tue Apr 17, 2007 4:48 pm    Post subject:
Reply with quote

Hi There

Declare O-GROSS-LN-AMT using mask

Code:
  O-GROSS-LN-AMT * 11 N 2 MASK '--------9.99'.
Back to top
View user's profile Send private message
SharathG

New User


Joined: 23 Jan 2007
Posts: 12
Location: India

PostPosted: Tue Apr 17, 2007 5:12 pm    Post subject: Re: Decimal field not displaying properly in output file
Reply with quote

Murali,

Is there a way by which we can display the decimal point in output file?

Ekta,

I tried out your solution. It is not working. Any other solution?
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Apr 17, 2007 10:59 pm    Post subject:
Reply with quote

Hello,

What will be the use of this output file? Is it a report or is it a data file to be read in some other program?

What does "is not working" tell us? Please show what error you received or what was put into the ouptut file.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Wed Apr 18, 2007 9:24 am    Post subject:
Reply with quote

Sharath,

As dick highlighted, if your OP file is being used as report only, you could use the following -

Code:

***** Temp vairable
OP-TEMP                                   W   11  N
 OP-TEMP-NON-DECIMAL      OP-TEMP              9  N
 OP-TEMP-DECIMAL             OP-TEMP       +9   2   N

**** Your variable decalred in A for writing '.' to op file
O-GROSS-LN-AMT                                                         W    12 A
 O-GROSS-LN-AMT-NON-DECIMAL  O-GROSS-LN-AMT             09 N
 O-GROSS-LN-AMT-POINT              O-GROSS-LN-AMT   +09    01 A VALUE '.'
 O-GROSS-LN-AMT-DECIMAL          O-GROSS-LN-AMT   +10    02 N

*** Move IP value to temp variable
OP-TEMP = I-GROSS-LN-AMT

*** Assign temp variable non-decimal & decimal to your op variable respectively
O-GROSS-LN-AMT-NON-DECIMAL  = OP-TEMP-NON-DECIMAL     
O-GROSS-LN-AMT-DECIMAL = OP-TEMP-DECIMAL
Back to top
View user's profile Send private message
SharathG

New User


Joined: 23 Jan 2007
Posts: 12
Location: India

PostPosted: Wed Apr 18, 2007 3:54 pm    Post subject: Re: Decimal field not displaying properly in output file
Reply with quote

Hi,

Sorry for not giving enough information. The output file is used as a data file.

This is our requirement: -

We have to convert a 'FOCUS' job to an Easytreive job. This FOCUS job reads some input file for processing and creates the data file without leading zeros and with decimal points, for numeric fields.

We then wrote an Easytreive job to perform the same function as the FOCUS job but the output data file from Easytreive did not match the output data file from FOCUS.

The FOCUS job created the data file with numeric fields having decimal points and non-leading zeros, whereas the Easytreive job created the data file without decimal point and had leading zeros for the numeric fields.

Finally, when I run a Compare job on both data files, the files should match.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Apr 21, 2007 6:46 am    Post subject:
Reply with quote

Hello,

Do you have this working?

To get the decimal-point into the output, look up MASK in your manual.

We're here if there are questions.
Back to top
View user's profile Send private message
SharathG

New User


Joined: 23 Jan 2007
Posts: 12
Location: India

PostPosted: Mon Apr 30, 2007 10:26 am    Post subject: Re: Decimal field not displaying properly in output file
Reply with quote

Hi,

MASK is working only with display statements.

But when i write the field into the output file, still the decimal point is not getting displayed.

Is there any other method by which i can get the decimal point to be displayed in the output file? I also want the leading zeros to be suppressed.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Mon Apr 30, 2007 11:14 am    Post subject:
Reply with quote

Sharath,

Did you try the code which I had provided earlier?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Apr 30, 2007 12:42 pm    Post subject: Re: Decimal field not displaying properly in output file
Reply with quote

SharathG wrote:
But when i write the field into the output file, still the decimal point is not getting displayed.
Is there any other method by which i can get the decimal point to be displayed in the output file? I also want the leading zeros to be suppressed.
You have found your problem, the MASK only applies to display and print files.
Either live with the leading zeros or output from the print routines or use something other than EZT.
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 Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am

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