hi ,
in my COBOL-DB2 PROJECT i wanted to implement the following code can u guide me in this regard.
IS THIS CORRECT ????
for example:
in my report there are severel fields and i wnted to add one more field DUE DATE
SELECT (DAYS(EXP DATE ) - DAYS(CURRENT DATE)) 'DAYS LEFT' INTO :WS-DUE DATE FROM CUSTTAB.
(*EXP DATE is one of the filed in table & also it is one of the field in my report)
(*CURRENT DATE i will retrieve by using SELECT CURRENT DATE FROM SYSIBM.SYSDUMMY1)
:WS-DUE DATE will be declared in working storage section
then to write into report , i will MOVE :WS-DUE DATE into DUE DATE
(* DUE DATE will be one of the field in REPORT-REC of my COBOL program)
then i will issue WRITE REPORT-REC
Joined: 06 Dec 2004 Posts: 200 Location: Keane India Ltd., Hyderabad
Hi,
Its fine Except in coding point of view....
1.The variables needs to have literals like DUE-DATE.
2. For documentation and maintainance purpose you need to declare the variable in 49 level as Host Variable if it is there in the table as column.
3. For Preformatting purpose you can use fillers before writing it to file.
4. Any way check it once with sample data.