| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| vijay Beginner
 
 
 Joined: 09 May 2003
 Posts: 131
 Topics: 64
 
 
 | 
			
				|  Posted: Tue Sep 14, 2004 8:40 am    Post subject: Numbers with decimal point in EZT |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		| kolusu Site Admin
 
  
 
 Joined: 26 Nov 2002
 Posts: 12394
 Topics: 75
 Location: San Jose
 
 | 
			
				|  Posted: Tue Sep 14, 2004 8:59 am    Post subject: |   |  
				| 
 |  
				| 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
 
 
 
 Hope this helps...
 
 Cheers
 
 Kolusu
 _________________
 Kolusu
 www.linkedin.com/in/kolusu
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		|  | 
	
		|  |