MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Numbers with decimal point in EZT

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
vijay
Beginner


Joined: 09 May 2003
Posts: 131
Topics: 64

PostPosted: Tue Sep 14, 2004 8:40 am    Post subject: Numbers with decimal point in EZT Reply with quote

Hi ,
I've a field in the record with value 1.2345 .I need to multiply this value with another numeric value in the file and get the output in 999.9999
format.How can I define these values and compute in EZT?

Thanks for your help.

VIjay
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Tue Sep 14, 2004 8:59 am    Post subject: Reply with quote

Vijay,

If you are writting to an output file, you need to redfine the whole and decimal portions seperately so that you will get the decimal point in the output.

Code:

//STEP0100 EXEC PGM=EZTPA00                       
//*                                               
//STEPLIB  DD DSN=EASYTREV.LOADLIB,     
//            DISP=SHR                           
//SYSPRINT DD SYSOUT=*                           
//SYSOUT   DD SYSOUT=*                           
//SYSSNAP  DD SYSOUT=*                           
//SYSUDUMP DD SYSOUT=*                           
//FILEIN   DD *                                   
0010                                             
0020                                             
//OUTFILE  DD SYSOUT=*,LRECL=80,RECFM=FB         
//SYSIN    DD *                                   
                                           
  FILE FILEIN                                 
       IN-AMT            01 04 N 0           
                                             
  W-OUTPUT               W  07 N 4           
    W-WHOLE   W-OUTPUT      03 N 0           
    W-DECIMAL W-OUTPUT +003 04 N 0           
                                             
  FILE OUTFILE                               
      OUT-AMT-WHOLE      01 03 A             
      OUT-AMT-DOT        04 01 A             
      OUT-AMT-DECIMAL    05 04 A             
                                             
  JOB INPUT FILEIN                           
                                             
      W-OUTPUT = IN-AMT * 1.2345             
                                             
      OUT-AMT-WHOLE    = W-WHOLE             
      OUT-AMT-DOT      = '.'                 
      OUT-AMT-DECIMAL  = W-DECIMAL           
                                             
      PUT OUTFILE                             


On the other hand if you are writting as report you can simply define it as follows

Code:

  W-RPT-VAR               W  07 N 4           


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group