|
My SQLRPGLE program compiles, but there is not data in the multiple occurence data structure after the RTV_CSR_IN routine. Is there a problem with my SQL code? Thanks, Frank '* D SQLMAXREC C CONST(50) '* D SQLDATA DS OCCURS(SQLMAXREC) D XFHOT LIKE( FHOT ) D XFHPRO LIKE( FHPRO ) D XFHDDAT LIKE( FHDDAT ) D XFHDTIM LIKE( FHDTIM ) D XFHDT LIKE( FHDT ) D XFHDADT LIKE( FHDADT ) D XFHPUDT LIKE( FHPUDT ) D XFHSCD LIKE( FHSCD ) D XFHCCD LIKE( FHCCD ) D XFHCCT LIKE( FHCCT ) D XFHCZIP LIKE( FHCZIP ) '* D DBSQLDATA DS OCCURS(SQLMAXREC) D SQLDATAROW LIKE(SQLDATA) * ********************************************************************** * * *INZSR - Initialization Subroutine * ********************************************************************** C *INZSR BEGSR ?* SQL C/EXEC SQL SQL C+ SET OPTION COMMIT = *NONE SQL C/END-EXEC ?* C ENDSR * ********************************************************************** * GET_TERM_BILLS - Get Freight Bills by Terminal ********************************************************************** P GET_TERM_BILLS B ?* ?* Get Numeric Version of Origin Terminal C IF #OT1 <> '*ALL' C EVAL NUM#OT1 = *ZEROS C #OT1 CHAIN AAL03002 C IF %FOUND(AAL03002) C EVAL NUM#OT1 = CT1TID C ENDIF C ENDIF ?* ?* Get Numeric Version of Destination Terminal C IF #DT1 <> '*ALL' C EVAL NUM#ODT = *ZEROS C #DT1 CHAIN AAL03002 C IF %FOUND(AAL03002) C EVAL NUM#ODT = CT1TID C ENDIF C ENDIF ?* ?* SQL Input Cursor Declaration SQL C/EXEC SQL | C+ DECLARE SQLDATAINPUT CURSOR FOR | C+ SELECT FHOT, FHPRO, FHDDAT, FHDTIM, FHDT, | C+ FHDADT, FHPUDT, FHSCD, FHCCD, FHCCT, FHCZIP | C+ FROM FRL00144 | C+ WHERE FHDDAT >= :FDATE AND FHDDAT <= :TDATE | C+ FOR READ ONLY | C/END-EXEC | '* SQL C EVAL EXIT = FALSE '* '* ----------------------------- '* Process Entire XXXXXXXXXXXXXX '* ----------------------------- C DOU EXIT <> FALSE SQL C/EXEC SQL | C+ OPEN SQLDATAINPUT | C/END-EXEC | C EVAL ROWIDX = 1 | C CALLP RTV_CSR_IN | ?* | C ROWIDX OCCUR SQLDATA | C MOVE SQLDATA DBSQLDATA | ?* SQL C EVAL ROWIDX = ROWIDX + 1 ?* ?* Validate Freight Bills C EVAL BADDATE = 'N' C EVAL NEXTFLG = 'N' C CALLP CHK_TERM_BILLS ?* ?* Invalid Date Range C IF BADDATE = 'Y' C LEAVE C ENDIF ?* ?* Invalid Freight Bill; Get Next Record C IF NEXTFLG = 'Y' C ITER C ENDIF ?* ?* Check Service Quality C CALLP CHK_SVC_QLTY ?* ?* Populate Work File(FR47P457) fields C CALLP POP_WORKF ?* ?* Write Record to Work File(FR47P457) C WRITE FREC457 ?* C ENDDO ?* DOU EXIT <> FALSE ?* SQL C/EXEC SQL | C+ CLOSE SQLDATAINPUT SQL C/END-EXEC ?* P GET_TERM_BILLS E * ***************************************************************** * RTV_CSR_IN - Retrieve Cursor In ***************************************************************** SQL P RTV_CSR_IN B | '* | C/EXEC SQL | C+ FETCH NEXT | C+ FROM SQLDATAINPUT | C+ FOR 50 ROWS | C+ INTO :DBSQLDATA | C/END-EXEC | ?* SQL P RTV_CSR_IN E **********************************************************************
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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.