View previous topic :: View next topic
|
Author |
Message |
srkumar422
New User
Joined: 27 Mar 2006 Posts: 16
|
|
|
|
Hi can we call a copybook?
i have code like this
-----------a929408--------
01 a
02 b pic x value space
02 c pic x value space
02 d pic x value space
----------------------------
This is a copy book.
now in cobol program he is calling this copy book, like
call a929408 using a.
what it means? is there any value assigned to those b,c,d variables? |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
I don't think so...
Maybe the programmer wrote it by mistake. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
you should do a FIND 'a929408' in your source code. Maybe there is a Reference Name A929408 someplace. If not, then the program will not compile. Did it compile? |
|
Back to top |
|
|
earsha
New User
Joined: 16 Mar 2007 Posts: 17 Location: Pune
|
|
|
|
we can't call a copy book! Instead you can copy the copybook into the source code. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
srkumar422,
Show a piece of code from the program, may be, you'll get better responses. By the way, did you follow Dick's suggestion, what was the result? |
|
Back to top |
|
|
chiranjeevi_mca
New User
Joined: 19 Feb 2006 Posts: 27
|
|
|
|
Hi,
Call statement is used to call sub programs only in cobol. COPY statement is used to add copybooks to cobol programs. Copy books will expand while compilation time.
your statemet meaning is calling a subprogram(a929408) using the Group Data-item A. means they already assingned the values for Elementary dataitems. In the called program may be the same structure will be used at in the Linkage section.
Regards |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
srkumar422 wrote: |
Hi can we call a copybook? |
No.
Quote: |
now in cobol program he is calling this copy book, like
call a929408 using a.
what it means? |
It probably means that there is a routine with the same name as the copybook. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Copybook a929408 contains the fields used by called module a929408.
Notice that the call specifies "using a" and "a" is the group field of the copybook. |
|
Back to top |
|
|
srkumar422
New User
Joined: 27 Mar 2006 Posts: 16
|
|
|
|
01 WK-CONSTANTS.
05 WK-PGM-NM PIC X(08) VALUE 'AVLB0501'.
05 WK-AVLB7506 PIC X(08) VALUE 'AVLB7506'.
05 WK-AVLB7507 PIC X(08) VALUE 'AVLB7507'.
05 WK-AVLB7508 PIC X(08) VALUE 'AVLB7508'.
05 WK-AVLB9998 PIC X(08) VALUE 'AVLB9998'.
05 WK-AVLB9999 PIC X(08) VALUE 'AVLB9999'.
05 WK-A9294A08 PIC X(08) VALUE 'A9294A08'.
05 WK-PGM-CNST-SEQ-NBR PIC S9(04) COMP VALUE 1.
05 WK-SQL-ERR-911 PIC S9(08) VALUE -911.
05 WK-SQL-ERR-913 PIC S9(08) VALUE -913.
----here he is intializing a variable [/img]WK-A9294A08 TO A9294A08------------
COPY A9294A08.
----Next hi is using this copy book A9294A08 ---------
016200* CALL A9294A08 TO GET INFO ABOUT THE CURRENT JOB.
016300**************************************************
016400
016500 CALL WK-A9294A08 USING WP-A9294A08-UPDT
016600
----Here is calling that copybook usning WK-A9294A08 -----
000200**********************************************************
000300* A9294A08 PARAMETERS
000400**********************************************************
000500
000600 01 WP-A9294A08-UPDT.
000700 05 WP-JOB-NM PIC X(08) VALUE SPACES.
000800 05 WP-STEP-NM PIC X(08) VALUE SPACES.
000900 05 WP-JOB-NBR PIC X(08) VALUE SPACES.
001000 05 WP-RMTID PIC X(08) VALUE SPACES.
001100 05 WP-JOB-TYPE PIC X(01) VALUE SPACES.
-------This is the copy book -------------
After call he is getting some values into these fields and he is using them further.
My question is how values are assigned to these fields with just CALL
Hi Dick,
i did search on A9294A08. In the following sections he is using variable of those copybook thats all. And the code is working fine since 4 years!!! |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
The call is filling in the information, job name, step name, job number and such....I have a similar subroutine at my shop..... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Find and look at the source for the called module.
When control is passed to A9294A08, it obtains system information and moves it into the WP-A9294A08-UPDT variables (this may be an assembler module).
Quote: |
My question is how values are assigned to these fields with just CALL |
The CALL passes control to A9294A08.
Let us know if this is not clear. |
|
Back to top |
|
|
|