Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DECIMAL

Status
Not open for further replies.

breyt

IS-IT--Management
Dec 9, 2002
66
FR
HI
I have in my report a field with a possibility of 2 decimal or none depending the value of the report:
amount/p15.2 if report code 001
amount/p15 if report code 002
how i can do that
thanks
breyt
 
If you can get the 'report type' value into an amper variable field (&REPTYPE, for example), the following should work:
-SET &FTYPE = if &REPTYPE EQ '001' THEN 'P15.2' ELSE 'P15';
-RUN
DEFINE FILE BLAH
AMOUNT/&FTYPE = ...;
END
TABLE FILE BLAH
SUM AMOUNT, etc.
END
-RUN

 
HI
thanks for the answer but I dont have the report code in an amper variable . I have only the report in the program
Breyt
 
Print two reports as follows:

TABLE FILE BLAH
SUM AMOUNT/P15.2
blah...
IF REPORT IS 001
END
TABLE FILE BLAH
SUM AMOUNT/P15
blah...
IF REPORT IS 002
END
 
HI
thanks but I need to run in the same report
I have found the solution ; I use subroutine FTOA with two different format depending the report

AM01A/A18=IF REPORT EQ 'REP01' THEN
FTOA (AM01,'(D14C)', AM01A) ELSE
FTOA (AM01,'(D15.2C)', AM01A);

breyt
 
Whcih release and what product?

With later releases, there's something called 'field-based reformatting', which allows the format for each row of a report to vary, base on a pre-defined specification.
 
HI
I working on mainframe with focus 7.11 and webfocus 5.
Breyt
 
WebFocus 5.2 has field-based reformatting. IBM Mainframe added it in release 7.2.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top