|
PROCESS APOST NOMONOPRC.
IDENTIFICATION DIVISION.
PROGRAM-ID. CGICBM24TT.
AUTHOR. PLA.
DATE-WRITTEN. 01/22/2001.
*
* Intranet links in javascript.
*
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. IBM-AS400.
OBJECT-COMPUTER. IBM-AS400.
SPECIAL-NAMES.
INPUT-OUTPUT SECTION.
FILE-CONTROL. DATA DIVISION.
FILE SECTION. WORKING-STORAGE SECTION.
EXEC SQL BEGIN DECLARE SECTION END-EXEC. EXEC SQL
INCLUDE SQLCA
END-EXEC. 01 WS-ERROR-API.
05 BYTES-INPUT PIC S9(09) BINARY.
05 BYTES-OUTPUT PIC S9(09) BINARY.
05 EXCEPTION-ID PIC X(07).
05 RESERVED-BYTE PIC X(01).
05 EXCEPTION-DATA PIC X(132). 01 WS-EOF-INDIC PIC 1.
88 END-OF-FILE VALUE B'1'.
88 NOT-END-OF-FILE VALUE B'0'. OPENING-PARAGRAPH.
EXEC SQL
DECLARE C1 CURSOR FOR
SELECT TITLE1,
URL
FROM QGPL/GPLPFM26D
WHERE SHOWLINK = :WS-Y AND
(USRPRF = :WS-USRPRF OR
USRPRF = :WS-BLANK-USRPRF)
ORDER BY TITLE1
FOR READ ONLY
END-EXEC.
PERFORM INITIALIZATION.
PERFORM GET-USER-PROFILE.
PERFORM WRITE-HEADER.
PERFORM WRITE-LINKS.
GOBACK. WRITE-HEADER.
STRING 'Content-type: text/html'
DELIMITED BY SIZE
INTO S
POINTER WS-STRING-LENGTH
END-STRING.
PERFORM WRITE-TO-STANDARD-OUTPUT 2 TIMES. WRITE-LINK.
STRING "document.write('"
'<A HREF="'
WS-URL
'">'
WS-TITLE1
'</A> | '
"');"
WS-BREAK
DELIMITED BY ' '
INTO S
POINTER WS-STRING-LENGTH
END-STRING.
PERFORM WRITE-TO-STANDARD-OUTPUT. WRITE-LINKS.
PERFORM OPEN-SQL-FILE.
PERFORM READ-URL-FILE.
PERFORM UNTIL SQLCODE NOT = 0
PERFORM WRITE-LINK
PERFORM READ-URL-FILE
END-PERFORM.
PERFORM CLOSE-SQL-FILE. * COPY BOOKS
COPY GETENV OF CGISRC-QCBLSRC.
COPY STDOUT OF CGISRC-QCBLSRC.
COPY GETUSRPRF OF CGISRC-QCBLSRC. OPEN-SQL-FILE.
EXEC SQL
OPEN C1
END-EXEC. READ-URL-FILE.
EXEC SQL
FETCH FROM C1
INTO :WS-TITLE1,
:WS-URL
END-EXEC. INITIALIZATION.
MOVE SPACES TO S.
COMPUTE WS-STRING-LENGTH = 1. CLOSE-SQL-FILE.
EXEC SQL
CLOSE C1
END-EXEC.When using SQL in COBOL programs, does the table need to be included in the file control section of the program with a Copy DD statement after the FD in the file section of the program? If anyone has done this using SQL to create the table, I would appreciate knowing that it is possible. Otherwise, I will use DDS to create the table so that I can get an external description of the table. Is there something that I've forgotten?
_______________________________________________ This is the COBOL Programming on the iSeries/AS400 (COBOL400-L) mailing list To post a message email: COBOL400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/cobol400-l or email: COBOL400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/cobol400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.