COPYBOOK use in SQL FETCH statement



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

COPYBOOK use in SQL FETCH statement

Postby kuldeep kularia » Mon Jun 05, 2017 5:43 pm

I have one doubt for using of copybook local variables in EXEC FETCH command .
like
DECLARE SECTION
05 D-CTR-ACCT-NUM OCCURS 500 TIMES PIC X 16
05 D-CTR-ACCT-BRANCH OCCURS 500 TIMES PIC X 5

------------
PROCEDURE
EXEC SQL FOR D-ROW-NUM
FETCH CURSOR_NAME
INTO D-CTR-ACCT-NUM,
D-CTR-ACCT-BRANCH,
D-CTR-DECI-OFFICER,

in above example of PCO program can we use copybook variable like
COPY UT9920CA IN LIBRYXXX. As I have tables copybook which I have to use for fetch into command variables .
kuldeep kularia
 
Posts: 2
Joined: Mon Jun 05, 2017 5:14 pm
Has thanked: 1 time
Been thanked: 0 time

Re: COPYBOOK use in SQL FETCH statement

Postby Robert Sample » Mon Jun 05, 2017 8:51 pm

Have you read the Enterprise COBOL Programming Guide at (version 6.1) http://publibfp.boulder.ibm.com/epubs/pdf/igy6pg10.pdf for your version of COBOL? If not, you need to -- start with Chapter 21 entitled Programming for a DB2 environment which discusses some of the differences in the way COPY statements are handled with the stand-alone DB2 preprocessor and the integrated DB2 coprocessor. The answer to your questions will depend upon which way you are compiling your code.

These users thanked the author Robert Sample for the post:
kuldeep kularia (Tue Jun 06, 2017 11:29 am)
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: COPYBOOK use in SQL FETCH statement

Postby kuldeep kularia » Tue Jun 06, 2017 11:29 am

Dear Robert ,


Thanks for the reference with below statement from your linked document prove that my requirement is not achievable . Thanks a lot.

The library search order for SQL INCLUDE statements is the same SYSLIB
concatenation as the compiler uses to resolve COBOL COPY statements that do not
specify a library-name
kuldeep kularia
 
Posts: 2
Joined: Mon Jun 05, 2017 5:14 pm
Has thanked: 1 time
Been thanked: 0 time


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post