Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
is it correct

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
Author Message
Prokis

New User


Joined: 10 Dec 2004
Posts: 7
Location: bangalore

PostPosted: Fri Dec 10, 2004 1:42 pm    Post subject: is it correct
Reply with quote

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
Back to top
View user's profile Send private message
References
ovreddy

Active User


Joined: 06 Dec 2004
Posts: 200
Location: Keane India Ltd., Hyderabad

PostPosted: Fri Dec 10, 2004 2:28 pm    Post subject: Its fine but...
Reply with quote

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.

Bye,
Reddy.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1