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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COBOL with temporary DB2 tables

Status
Not open for further replies.

Emmaar

Programmer
Jan 7, 2003
11
0
0
GB
Hello,

Can I have a SQL like the one below in a COBOL-DB2 program.

SELECT R25.ACCTG_PREM
FROM UP1DBAP.TDB01R25 R25,
(SELECT MAX(ST_ACTION_DATE)
AS THFMAX
FROM UP1DBAP.TD4101R1
WHERE SOL_TRANS_CONT_NO = :H-POL-NO
AND ST_CODE NOT LIKE '%R') AS TEMP
WHERE R25.POL_NO = :H-POL-NO
AND TEMP.THFMAX BETWEEN R25.ACCTG_PREM_FST_DUE AND
R25.ACCTG_PREM_LST_DUE

Thanks in advance.

Ramkumar



 
Yes u can do it provided the Id with which you are exceuting this Cobol Script has the permission to create the TEMP table or rather a Table in the Table space you are executing this Program.
 
I believe that the table named TEMP is not physically created/stored when the program is run. Please correct me if my understanding is wrong.
A person without any Tablespace allocated for his Id can run the above query in Production QMF. So I thought that the query above will work in Cobol programs running under OS/390.

Ramkumar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top