Subject: | |
From: | |
Reply To: | |
Date: | Mon, 6 Aug 2001 18:24:31 -0400 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
On Mon, 6 Aug 2001 15:41:49 -0600, [log in to unmask] wrote:
>I am using COBOL macro to perform call to IMAGE database in my COBOL
>program. All these macros are in a copybook and all needed macros are
>included in program. But when I compile my program it gives following
>error
> 01760 662000 %BASE DISTR
> 01760 DEFINES 662000 REPLACE ==`== BY =='==
> 01761 001800 ==(DB)== BY DISTR
> 01761 663000 %DBOPEN.
> 01761 663000 COPY DBOPEN OF CL .
> 01761 664000
[...]
> 01761 671000 %DBUNLOCK.
> 01761 671000 COPY DBUNLOCK OF CL .
> 01761 672000
> 01761 673000 %DBCLOSE.
> 01761 673000 COPY DBCLOSE OF CL .
> 01761 COPY CSICALLS.
> 01761 COPY DBABORT OF CL.
> 01761
>674000**********************************************************
>
>PAGE 0002/COBTEXT HBDSMNRS COBOL ERRORS and WARNINGS
>COBOL ERRORS:
>LINE # SEQ # COL ERROR SEV TEXT OF MESSAGE
>------ ------ --- ----- --- ---------------
> 01761 08 496 D EARLY END OF FILE ON FILE COBTEXT , END
> OF FILE (FSERR 0).
> 01761 001800 38 289 Q INVALID TOKEN IN COPY...REPLACING OR
> REPLACE CLAUSE.
It might be helpful to see the original copylib/macro items rather than the
compiled output -- however, I noticed that EVERY line of the (I presume)
macro expansion is listed as line "01761". As a "for instance", here is a
macro I'm using in some of my code:
358.1 $DEFINE %PRINTLINE=
358.2 MOVE SPACES TO REPORT-LINE
358.3 MOVE !1 TO REPORT-TAG
358.4 STRING !2
358.5 DELIMITED BY SIZE
358.6 INTO REPORT-DATA
358.7 WRITE REPORT-BUFFER FROM REPORT-LINE
358.8 #
358.9 $DEFINE %BLANKLINE=
359 MOVE SPACES TO REPORT-LINE
359.1 WRITE REPORT-BUFFER FROM REPORT-LINE
359.2 #
359.3
359.4 %BLANKLINE
359.5 %PRINTLINE("MDI "#, CUST-MAST-INFACT-NO#)
The "expanded" code appears like this in the compilation listing:
07254 373900$DEFINE %PRINTLINE=
07254 374000 MOVE SPACES TO REPORT-LINE
07254 374100 MOVE !1 TO REPORT-TAG
07254 374200 STRING !2
07254 374300 DELIMITED BY SIZE
07254 374400 INTO REPORT-DATA
07254 374500 WRITE REPORT-BUFFER FROM REPORT-LINE
07254 374600 #
07254 374700$DEFINE %BLANKLINE=
07254 374800 MOVE SPACES TO REPORT-LINE
07254 374900 WRITE REPORT-BUFFER FROM REPORT-LINE
07254 375000 #
07254 375100
07255 375200 %BLANKLINE
07255 374800 MOVE SPACES TO REPORT-LINE
07256 374900 WRITE REPORT-BUFFER FROM REPORT-LINE
07257 375000
07258 375300 %PRINTLINE("MDI "#, CUST-MAST-INFACT-NO#)
07258 374000 MOVE SPACES TO REPORT-LINE
07259 374100 MOVE "MDI " TO REPORT-TAG
07260 374200 STRING CUST-MAST-INFACT-NO
07261 374300 DELIMITED BY SIZE
07262 374400 INTO REPORT-DATA
07263 374500 WRITE REPORT-BUFFER FROM REPORT-LINE
07264 374600
Note that the compiler listing shows the "orginal" line of code followed by
the "expanded" code -- your listing above looks like only the start of a
macro definition, not a completed/replaced listing.
Note also the "special characters" needed to define a COBOL MACRO: $, %, =,
and most importantly: #. From your listing, I don't see the
terminating "#" character, which may be what the compiler is complaining
about...
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|
|
|