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

Decimal field not displaying properly in output file


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
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
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: 1436
Location: Bangalore,India

PostPosted: Tue Apr 17, 2007 4:40 pm
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: 1208
Location: Bangalore,India

PostPosted: Tue Apr 17, 2007 4:48 pm
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
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

Moderator Emeritus


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

PostPosted: Tue Apr 17, 2007 10:59 pm
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: 1436
Location: Bangalore,India

PostPosted: Wed Apr 18, 2007 9:24 am
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
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

Moderator Emeritus


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

PostPosted: Sat Apr 21, 2007 6:46 am
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
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: 1436
Location: Bangalore,India

PostPosted: Mon Apr 30, 2007 11:14 am
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: 3156
Location: Tucson AZ

PostPosted: Mon Apr 30, 2007 12:42 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top