velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "DiFrango, Ron" <ron.difra...@capitalone.com>
Subject Template Size
Date Tue, 13 Jul 2004 03:38:06 GMT
All,

Not sure if anyone else has tried something like this, but I am trying to
use Velocity to generate some COBOL code.  The problem I am running into is
that my template file is getting cut off after 196 lines of the input file.
If you look at the template file below, it is getting cutoff at the line
that reads: MOVE W6RTW TO P6RTW.

Any help would be appreciated and thanks in advance.

Here is my template file:

       CBL DYNAM

       IDENTIFICATION DIVISION.

      *

     H* SYNOPSIS :

     H*  SKELETON FOR INLINE N9 ROUTER QUERY

      *

     H* Company    : London Bridge Software

     H* System     : Debt Manager C/S V3.4 & WEB V1.3 (S390-CBL)

     H* Date       : 16 MAR 2004 time: 12:00:00

     H* Copyright  : London Bridge Software

      *

      *==============================================================

     M* MAINTENANCE   :

     M*

      *==============================================================

       PROGRAM-ID.  ZKXUP91R.

      ***************************************************************

       ENVIRONMENT DIVISION.

       CONFIGURATION SECTION.

       SOURCE-COMPUTER.  IBM-3090.

       OBJECT-COMPUTER.  IBM-3090.

      ***************************************************************

       INPUT-OUTPUT SECTION.

       FILE-CONTROL.

      *

       I-O-CONTROL.

      *

      ***************************************************************

       DATA DIVISION.

       FILE SECTION.

      *

      ***************************************************************

       WORKING-STORAGE SECTION.

      *

      *    SQL I-O feedback area and return codes

               EXEC SQL

                 INCLUDE SQLCA

               END-EXEC

      *

       77  SQL-IO-OK               PIC S9(4) COMP-4 VALUE ZEROS.

       77  SQL-NO-RECORD           PIC S9(4) COMP-4 VALUE 100.

      *

       01  WS-PGM-ERR-INFO.

           05  WS-PGM-NAME              PIC X(10) VALUE SPACES.

           05  WS-PGM-GENDATE           PIC X(8) VALUE SPACES.

           05  WS-PGM-GENTIME           PIC X(8) VALUE SPACES.

           05  WS-PGM-SQLCA             PIC X(136) VALUE SPACES.

           05  WS-PGM-SQL-LOC           PIC X(12) VALUE SPACES.

           05  WS-PGM-SQL-TYPE          PIC X(10) VALUE SPACES.

           05  WS-PGM-SQL-TABLE         PIC X(16) VALUE SPACES.

      *

      *    *API Exec'd Pgm Rtn Code

       01  W6RTW PIC S9(9) COMP-4.

       01  W0RTN PIC X(7).

       01  W1RTRACC PIC S9(9) COMP-3.

      * JOB & MESSAGE CONTEXT

       01  PROGRAMID PIC X(10) VALUE SPACES.

       01  ZAMSID PIC X(7) VALUE SPACES.

       01  ZAMSDA PIC X(132) VALUE SPACES.

       01  ZAPGMQ PIC X(10) VALUE SPACES.

       01  ZAPGRL PIC X(5) VALUE SPACES.

       01  ZAMSTP PIC X(7) VALUE SPACES.

       01  ZAMSGF PIC X(10) VALUE SPACES.

      *

       01  QRYRCDCNT        PIC ZZZZZZZ9 VALUE ZERO.

      *--------------------------------------------------------------

      * WORKING STORAGE VERSION OF LINKAGE PARAMETERS USED IN SQL

      *    JL:From Router Acc#

       01  WS-P1FROMACC PIC S9(9) COMP-3 VALUE ZEROS.

      *    JL:To Router Acc#

       01  WS-P2TOACC PIC S9(9) COMP-3 VALUE ZEROS.

      ***************************************************************

       LINKAGE SECTION.

      *    Return code

       01  P0RTN PIC X(7).

      *    JL:From Router Acc#

       01  P1FROMACC PIC S9(9) COMP-3.

      *    JL:To Router Acc#

       01  P2TOACC PIC S9(9) COMP-3.

      *    O5:EVENT CODE

       01  P3EVTCDE PIC X(6).

      *    FF:Exec as inline query?

       01  P4INLINEQRY PIC X(1).

      *    FF:Query True?

       01  P5QRYTRUE PIC X(1).

      *    *API Exec'd Pgm Rtn Code

       01  P6RTW PIC S9(9) COMP-4.

      ***************************************************************

       PROCEDURE DIVISION USING

      *    *Return Code

             P0RTN

      *    JL:From Router Acc#

             P1FROMACC

      *    JL:To Router Acc#

             P2TOACC

      *    O5:EVENT CODE

             P3EVTCDE

      *    FF:Exec as inline query?

             P4INLINEQRY

      *    FF:Query True?

             P5QRYTRUE

      *    *API Exec'd Pgm Rtn Code

             P6RTW

           .

      ***************************************************************

       MAINLINE SECTION.

      *    Initialize

           MOVE SPACES TO P0RTN

           MOVE SPACES TO W0RTN

           MOVE SPACES TO P5QRYTRUE

      *    *API Exec'd Pgm Rtn Code will hold SQLCODE if query fails.

           MOVE ZEROS TO P6RTW

           MOVE ZEROS TO W6RTW

           MOVE ZEROS TO W1RTRACC

      *    ENSURE LINKAGE PARAMETERS USED IN SQL ARE IN WS VARIABLES

           MOVE P1FROMACC TO WS-P1FROMACC

           MOVE P2TOACC TO WS-P2TOACC

      *    Build program name & source date/time

           MOVE SPACES TO PROGRAMID

           STRING 'ZK'   DELIMITED BY SIZE

                  P3EVTCDE  DELIMITED BY SIZE

                  INTO PROGRAMID

           MOVE '20040316' TO WS-PGM-GENDATE

           MOVE '12:00:00' TO WS-PGM-GENTIME

      *

           IF (P4INLINEQRY = 'Y') THEN

      *==============================================================

      *    EXAMPLE OF A ROUTER SQL QUERY USING N9DEBTP AS PRIMARY TABLE

      *    WHERE RESULT IS DETERMINED BY VARIABLE RETURNED.

      * Set SQL Error Diagnostics

             MOVE 'MAINLINE/01 '       TO WS-PGM-SQL-LOC

             MOVE 'SELECT    '         TO WS-PGM-SQL-TYPE

             MOVE 'N9DEBTP         '   TO WS-PGM-SQL-TABLE

      * This is the inline query

      *-----------*** INSERT USER SELECTION CRITERIA HERE ***-----------

          
          #foreach ($arg in $qc.inlineQuery) $arg #end

      *-----------****** END OF USER SELECTION CRITERIA *****-----------

      *-----------------------------------------------------------------

      *    Deal with any SQL errors

           IF (SQLCODE < ZEROES) THEN

               MOVE SQLCODE TO W6RTW

               MOVE 'Y2U9999' TO W0RTN

               PERFORM ZWEXPG

           END-IF

      *-----------------------------------------------------------------

      *    SET QUERY TRUE FLAG IF ACCOUNT WAS SELECTED

           IF (P1FROMACC = W1RTRACC) THEN

               MOVE 'Y' TO P5QRYTRUE

           END-IF

      *==============================================================

           ELSE

      *    EXAMPLE OF A ROUTER SQL QUERY USING OCWORK AS PRIMARY TABLE

      *    QUERY SELECTS ALL ACCOUNTS BETWEEN RANGE AND PRESENT IN OCWORKP.

      *    RESULTS INSERTED INTO FILE OPDEBTP

      *-----------------------------------------------------------------

      *    Send impromptu message that qry is running

                MOVE '*INFO  ' TO ZAMSTP

                MOVE 'SQL RTR QRY is running'   TO ZAMSDA

                PERFORM ZASNMS

      *-----------------------------------------------------------------

      * RUN THE QUERY

      * Set SQL Error Diagnostics

             MOVE 'MAINLINE/02 '       TO WS-PGM-SQL-LOC

             MOVE 'SELECT    '         TO WS-PGM-SQL-TYPE

             MOVE 'N9DEBTP         '   TO WS-PGM-SQL-TABLE

      * This is the query that writes to OPDEBTP

      *-----------*** INSERT USER SELECTION CRITERIA HERE ***-----------

      
          #foreach ($arg in $qc.insertQuery) $arg #end
      
      *-----------****** END OF USER SELECTION CRITERIA *****-----------

      *-----------------------------------------------------------------

      *    Deal with any SQL errors

           IF (SQLCODE < ZEROES) THEN

               MOVE SQLCODE TO W6RTW

               MOVE 'Y2U9999' TO W0RTN

               PERFORM ZWEXPG

           END-IF

      *-----------------------------------------------------------------

      *    Send impromptu message that qry has finished with row count

                MOVE '*INFO  ' TO ZAMSTP

                MOVE SQLERRD(3)             TO QRYRCDCNT

                STRING 'SQL QRY Finished, INSERTS=' DELIMITED BY SIZE

                       QRYRCDCNT  DELIMITED BY SIZE

                       INTO ZAMSDA

                PERFORM ZASNMS

      *-----------------------------------------------------------------

      *    End of inline query test

           END-IF

      *=================================================================

      *    Exit program normal

      *    *Return code

           MOVE W0RTN TO P0RTN

           MOVE W6RTW TO P6RTW

           GOBACK.

           CONTINUE.

      *==============================================================

       ZASNMS SECTION.

       ZASNMS-PARAGRAPH.

      *==============================================================

      *    Send to message queue

      *==============================================================

           MOVE PROGRAMID TO ZAPGMQ

           MOVE SPACES  TO ZAMSGF

           MOVE '*EXT ' TO ZAPGRL

           CALL 'Y2SNMGCZ' USING

      *    Program queue

             ZAPGMQ

      *    Relative queue

             ZAPGRL

      *    Message ID

             ZAMSID

      *    Message file

             ZAMSGF

      *    Message data

             ZAMSDA

      *    Message type

             ZAMSTP

           END-CALL

      *    Clear all fields for default mechanism next time

      *    Program queue

           MOVE SPACES TO ZAPGMQ

      *    Relative queue

           MOVE SPACES TO ZAPGRL

      *    Message ID

           MOVE SPACES TO ZAMSID

      *    Message file

           MOVE SPACES TO ZAMSGF

      *    Message data

           MOVE SPACES TO ZAMSDA

      *    Message type

           MOVE SPACES TO ZAMSTP

      *==============================================================

           CONTINUE.

       ZAEXIT.

           EXIT.

      *==============================================================

       ZWEXPG SECTION.

       ZWEXPG-PARAGRAPH.

      *    SQL ERROR ROUTINE - CALL SQL ERROR HANDLER

           MOVE PROGRAMID TO WS-PGM-NAME

           MOVE SQLCA TO WS-PGM-SQLCA

           CALL 'Y2SQERKZ' USING

            WS-PGM-ERR-INFO

           END-CALL

           CONTINUE.

      *    SQL ERROR HANDLER MAY ALLOW ERROR SO RETURN TO PROGRAM LOGIC

       ZWEXPG-END.

           MOVE ZEROS TO SQLCODE

           CONTINUE.

       ZWEXPG-EXIT.

           EXIT.


And the sample output:

       CBL DYNAM

       IDENTIFICATION DIVISION.

      *

     H* SYNOPSIS :

     H*  SKELETON FOR INLINE N9 ROUTER QUERY

      *

     H* Company    : London Bridge Software

     H* System     : Debt Manager C/S V3.4 & WEB V1.3 (S390-CBL)

     H* Date       : 16 MAR 2004 time: 12:00:00

     H* Copyright  : London Bridge Software

      *

      *==============================================================

     M* MAINTENANCE   :

     M*

      *==============================================================

       PROGRAM-ID.  ZKXUP91R.

      ***************************************************************

       ENVIRONMENT DIVISION.

       CONFIGURATION SECTION.

       SOURCE-COMPUTER.  IBM-3090.

       OBJECT-COMPUTER.  IBM-3090.

      ***************************************************************

       INPUT-OUTPUT SECTION.

       FILE-CONTROL.

      *

       I-O-CONTROL.

      *

      ***************************************************************

       DATA DIVISION.

       FILE SECTION.

      *

      ***************************************************************

       WORKING-STORAGE SECTION.

      *

      *    SQL I-O feedback area and return codes

               EXEC SQL

                 INCLUDE SQLCA

               END-EXEC

      *

       77  SQL-IO-OK               PIC S9(4) COMP-4 VALUE ZEROS.

       77  SQL-NO-RECORD           PIC S9(4) COMP-4 VALUE 100.

      *

       01  WS-PGM-ERR-INFO.

           05  WS-PGM-NAME              PIC X(10) VALUE SPACES.

           05  WS-PGM-GENDATE           PIC X(8) VALUE SPACES.

           05  WS-PGM-GENTIME           PIC X(8) VALUE SPACES.

           05  WS-PGM-SQLCA             PIC X(136) VALUE SPACES.

           05  WS-PGM-SQL-LOC           PIC X(12) VALUE SPACES.

           05  WS-PGM-SQL-TYPE          PIC X(10) VALUE SPACES.

           05  WS-PGM-SQL-TABLE         PIC X(16) VALUE SPACES.

      *

      *    *API Exec'd Pgm Rtn Code

       01  W6RTW PIC S9(9) COMP-4.

       01  W0RTN PIC X(7).

       01  W1RTRACC PIC S9(9) COMP-3.

      * JOB & MESSAGE CONTEXT

       01  PROGRAMID PIC X(10) VALUE SPACES.

       01  ZAMSID PIC X(7) VALUE SPACES.

       01  ZAMSDA PIC X(132) VALUE SPACES.

       01  ZAPGMQ PIC X(10) VALUE SPACES.

       01  ZAPGRL PIC X(5) VALUE SPACES.

       01  ZAMSTP PIC X(7) VALUE SPACES.

       01  ZAMSGF PIC X(10) VALUE SPACES.

      *

       01  QRYRCDCNT        PIC ZZZZZZZ9 VALUE ZERO.

      *--------------------------------------------------------------

      * WORKING STORAGE VERSION OF LINKAGE PARAMETERS USED IN SQL

      *    JL:From Router Acc#

       01  WS-P1FROMACC PIC S9(9) COMP-3 VALUE ZEROS.

      *    JL:To Router Acc#

       01  WS-P2TOACC PIC S9(9) COMP-3 VALUE ZEROS.

      ***************************************************************

       LINKAGE SECTION.

      *    Return code

       01  P0RTN PIC X(7).

      *    JL:From Router Acc#

       01  P1FROMACC PIC S9(9) COMP-3.

      *    JL:To Router Acc#

       01  P2TOACC PIC S9(9) COMP-3.

      *    O5:EVENT CODE

       01  P3EVTCDE PIC X(6).

      *    FF:Exec as inline query?

       01  P4INLINEQRY PIC X(1).

      *    FF:Query True?

       01  P5QRYTRUE PIC X(1).

      *    *API Exec'd Pgm Rtn Code

       01  P6RTW PIC S9(9) COMP-4.

      ***************************************************************

       PROCEDURE DIVISION USING

      *    *Return Code

             P0RTN

      *    JL:From Router Acc#

             P1FROMACC

      *    JL:To Router Acc#

             P2TOACC

      *    O5:EVENT CODE

             P3EVTCDE

      *    FF:Exec as inline query?

             P4INLINEQRY

      *    FF:Query True?

             P5QRYTRUE

      *    *API Exec'd Pgm Rtn Code

             P6RTW

           .

      ***************************************************************

       MAINLINE SECTION.

      *    Initialize

           MOVE SPACES TO P0RTN

           MOVE SPACES TO W0RTN

           MOVE SPACES TO P5QRYTRUE

      *    *API Exec'd Pgm Rtn Code will hold SQLCODE if query fails.

           MOVE ZEROS TO P6RTW

           MOVE ZEROS TO W6RTW

           MOVE ZEROS TO W1RTRACC

      *    ENSURE LINKAGE PARAMETERS USED IN SQL ARE IN WS VARIABLES

           MOVE P1FROMACC TO WS-P1FROMACC

           MOVE P2TOACC TO WS-P2TOACC

      *    Build program name & source date/time

           MOVE SPACES TO PROGRAMID

           STRING 'ZK'   DELIMITED BY SIZE

                  P3EVTCDE  DELIMITED BY SIZE

                  INTO PROGRAMID

           MOVE '20040316' TO WS-PGM-GENDATE

           MOVE '12:00:00' TO WS-PGM-GENTIME

      *

           IF (P4INLINEQRY = 'Y') THEN

      *==============================================================

      *    EXAMPLE OF A ROUTER SQL QUERY USING N9DEBTP AS PRIMARY TABLE

      *    WHERE RESULT IS DETERMINED BY VARIABLE RETURNED.

      * Set SQL Error Diagnostics

             MOVE 'MAINLINE/01 '       TO WS-PGM-SQL-LOC

             MOVE 'SELECT    '         TO WS-PGM-SQL-TYPE

             MOVE 'N9DEBTP         '   TO WS-PGM-SQL-TABLE

      * This is the inline query

      *-----------*** INSERT USER SELECTION CRITERIA HERE ***-----------

          
                     EXEC SQL
            SELECT ND9E5CD
            INTO :W1RTRACC
            FROM N9DEBTP, NNDEBTP, NDDEBTP
            WHERE ND9E5CD = :WS-P1FROMACC
            AND N9E5CD = NDE5CD
            AND NNDDCE = NDDDCE
            AND NDX9CF = 'AK'
            AND NNU8NB = 1
            WITH UR
            END-EXEC
 
      *-----------****** END OF USER SELECTION CRITERIA *****-----------

      *-----------------------------------------------------------------

      *    Deal with any SQL errors

           IF (SQLCODE < ZEROES) THEN

               MOVE SQLCODE TO W6RTW

               MOVE 'Y2U9999' TO W0RTN

               PERFORM ZWEXPG

           END-IF

      *-----------------------------------------------------------------

      *    SET QUERY TRUE FLAG IF ACCOUNT WAS SELECTED

           IF (P1FROMACC = W1RTRACC) THEN

               MOVE 'Y' TO P5QRYTRUE

           END-IF

      *==============================================================

           ELSE

      *    EXAMPLE OF A ROUTER SQL QUERY USING OCWORK AS PRIMARY TABLE

      *    QUERY SELECTS ALL ACCOUNTS BETWEEN RANGE AND PRESENT IN OCWORKP.

      *    RESULTS INSERTED INTO FILE OPDEBTP

      *-----------------------------------------------------------------

      *    Send impromptu message that qry is running

                MOVE '*INFO  ' TO ZAMSTP

                MOVE 'SQL RTR QRY is running'   TO ZAMSDA

                PERFORM ZASNMS

      *-----------------------------------------------------------------

      * RUN THE QUERY

      * Set SQL Error Diagnostics

             MOVE 'MAINLINE/02 '       TO WS-PGM-SQL-LOC

             MOVE 'SELECT    '         TO WS-PGM-SQL-TYPE

             MOVE 'N9DEBTP         '   TO WS-PGM-SQL-TABLE

      * This is the query that writes to OPDEBTP

      *-----------*** INSERT USER SELECTION CRITERIA HERE ***-----------

      
                     EXEC SQL
            INSERT INTO OPDEBTP (OPE5CD, OPASCD, OPE3CD, OPCHNB)
            SELECT OCE5CD, OCASCD, OCE3CD, OCCHNB
            FROM OCWORKP, NNDEBTP, NDDEBTP
            WHERE OCE5CD BETWEEN :WS-P1FROMACC AND :WS-P2TOACC
            AND OCE5CD = NDE5CD
            AND NNDDCE = NDDDCE
            AND NDX9CF = 'AK'
            AND NNU8NB = 1
            GROUP BY OCE5CD, OCASCD, OCE3CD, OCCHNB
            END-EXEC
       
      *-----------****** END OF USER SELECTION CRITERIA *****-----------

      *-----------------------------------------------------------------

      *    Deal with any SQL errors

           IF (SQLCODE < ZEROES) THEN

               MOVE SQLCODE TO W6RTW

               MOVE 'Y2U9999' TO W0RTN

               PERFORM ZWEXPG

           END-IF

      *-----------------------------------------------------------------

      *    Send impromptu message that qry has finished with row count

                MOVE '*INFO  ' TO ZAMSTP

                MOVE SQLERRD(3)             TO QRYRCDCNT

                STRING 'SQL QRY Finished, INSERTS=' DELIMITED BY SIZE

                       QRYRCDCNT  DELIMITED BY SIZE

                       INTO ZAMSDA

                PERFORM ZASNMS

      *-----------------------------------------------------------------

      *    End of inline query test

           END-IF

      *=================================================================

      *    Exit program normal

      *    *Return code

           MOVE W0RTN TO P0RTN

           MOVE W6RTW TO P6RTW                          
 
**************************************************************************
The information transmitted herewith is sensitive information intended only
for use by the individual or entity to which it is addressed. If the reader
of this message is not the intended recipient, you are hereby notified that
any review, retransmission, dissemination, distribution, copying or other
use of, or taking of any action in reliance upon this information is
strictly prohibited. If you have received this communication in error,
please contact the sender and delete the material from your computer.

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message