IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Precompiler vs Coprocessor


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jle1966

New User


Joined: 11 Jun 2009
Posts: 3
Location: Brussels

PostPosted: Thu Jan 21, 2010 3:04 pm
Reply with quote

Hi,

When using the precompiler it is possible to give a //SYSLIB dataset name in order to resolve the include statements. During Cobol compilation, the //SYSLIB is used to resolve the Cobol copybooks.

It is possible to specify 2 different syslibs dd's when using the Coprocessor? One for the DB2 includes, one other for the Cobol copybooks? If so, what are the DD names?

Thanks in advance,

Johan
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Jan 21, 2010 3:23 pm
Reply with quote

Maybe the following will help :

Code:

//DB2COMP (XXX,XXX),'COMPILE JCL',                           
//             CLASS=A,MSGCLASS=A,NOTIFY=&SYSUID                     
//********************************************************************
//* COMPILATION, LINK EDIT AND THE BIND STEP FOR A COBOL DB2 PROGRAM *
//* WILL BE DONE BY SUBMITTING THIS JOB.                             *
//* THE DB2 REGIONS AND CORRESPONDING PARAMETERS NEEDS TO BE CHANGED *
//* WITH RESPECT TO THE PROGRAM                                      *
//********************************************************************
//*                 PRECOMPILE DB2 PROGRAM                           *
//*--------------  LOCATION OF DBRM LIBRARY -------------------------*
//********************************************************************
//PC       EXEC PGM=DSNHPC,                                           
//             PARM='HOST(COB2),APOST,SOURCE',                       
//             REGION=4096K                                           
//DBRMLIB  DD  DISP=SHR,                                             
//             DSN=DEV.userid.DBRM(DB2PROG)    <------------------------ (1)                   
//STEPLIB  DD  DISP=SHR,                                             
//             DSN=SYSX.DB2.XXX.XXXXX 
//******************************************************************** 
//*SYSIN -----------INPUT COBOL DB2 PROGRAM LOCATION-----------------* 
//******************************************************************** 
//SYSIN    DD  DISP=SHR,                                               
//             DSN=DEV.userid.SRC(DB2PROG)     <----------------------  (2)                     
//SYSCIN   DD  DISP=(MOD,PASS),                                         
//             DSN=&&TEMP,                                           
//             SPACE=(800,(500,500)),                                   
//             UNIT=SYSDA                                               
//******************************************************************** 
//*                          DCLGEN MEMBER LOCATION                  * 
//*SYSLIB-----------------INPUT SOURCE LIBRARY FOR SQL---------------* 
//******************************************************************** 
//SYSLIB   DD  DISP=SHR,                                               
//             DSN=DEV.userid.DCL               <---------------------- (3)                         
//         DD  DISP=SHR,                                               
//             DSN=DEV.userid.CPY                             
//SYSPRINT DD  SYSOUT=T                                               
//SYSTERM  DD  SYSOUT=T                                               
//SYSUDUMP DD  SYSOUT=*                                               
//SYSUT1   DD  SPACE=(800,(500,500),,,ROUND),                         
//             UNIT=SYSDA                                             
//SYSUT2   DD  SPACE=(800,(500,500),,,ROUND),                         
//             UNIT=SYSDA                                             
//*                                                                   
//********************************************************************
//*                         COMPILATION                              *
//********************************************************************
//*                                                                   
//COB      EXEC PGM=IGYCRCTL,                                         
//             COND=(4,LT,PC),                                         
//             PARM=('SIZE(4000K),BUFSIZE(32760),LIST,LIB,MAP,OBJECT',
//             'DATA(31),XREF,RENT'),                                 
//             REGION=4M
//STEPLIB  DD  DISP=SHR,                                               
//             DSN=XXXX.XXXXXX                                       
//SYSIN    DD  DISP=(OLD,DELETE),                                     
//             DSN=&&TEMP                                           
//SYSLIN   DD  DISP=(MOD,PASS),                                       
//             DSN=&&LOADTMP,                                         
//             SPACE=(800,(500,500)),                                 
//             UNIT=SYSDA                                             
//********************************************************************
//*--------------SOURCE LIBRARIES FOR COBOL DB2 CODE (COPY LIBRARIES)*
//********************************************************************
//SYSLIB   DD  DISP=SHR,                                               
//             DSN=DEV.userid.DCL              <-----------------  (4)
//         DD  DSN=DEV.userid.CPY,DISP=SHR
//SYSPRINT DD  SYSOUT=*                                               
//SYSUDUMP DD  SYSOUT=*                                               
//SYSUT1   DD  SPACE=(800,(500,500),,,ROUND),                         
//             UNIT=SYSDA                                             
//SYSUT2   DD  SPACE=(800,(500,500),,,ROUND),                         
//             UNIT=SYSDA                                             
//SYSUT3   DD  SPACE=(800,(500,500),,,ROUND),                         
//             UNIT=SYSDA                                             
//SYSUT4   DD  SPACE=(800,(500,500),,,ROUND),                         
//             UNIT=SYSDA                                             
//SYSUT5   DD  SPACE=(800,(500,500),,,ROUND),                         
//             UNIT=SYSDA                                             
//SYSUT6   DD  SPACE=(800,(500,500),,,ROUND),                         
//             UNIT=SYSDA                                             
//SYSUT7   DD  SPACE=(800,(500,500),,,ROUND),                         
//             UNIT=SYSDA                                             
//*                                                                   
//*                                                                     
//******************************************************************** 
//*                         LINK EDIT                                * 
//******************************************************************** 
//*                                                                     
//LKED     EXEC PGM=IEWL,                                               
//             COND=((4,LT,COB),(4,LT,PC)),                             
//             PARM='XREF'                                             
//SYSLIB   DD  DISP=SHR,                                               
//             DSN=SXXX.SXXXXXXX                                       
//         DD  DISP=SHR,                                               
//             DSN=XXXX.DB2.XXX.XXXXLOAD                               
//         DD  DISP=SHR,                                               
//             DSN=SYS1.VSCLLIB                                         
//SYSLIN   DD  DISP=(OLD,DELETE),                                       
//             DSN=&&LOADTMP                                           
//*        DD  DDNAME=SYSIN                                             
//******************************************************************** 
//*----------------LOCATION OF LOAD LIBRARY--------------------------* 

//SYSLMOD  DD  DISP=SHR,                                               
//             DSN=DEV.userid.LOADLIB(DB2PROG)    <------------  (5)                   
//SYSPRINT DD  SYSOUT=*                                                 
//SYSUDUMP DD  SYSOUT=*                                                 
//SYSUT1   DD  SPACE=(1024,(50,50)),                                   
//             UNIT=SYSDA                                               
//*                                                                     
//******************************************************************** 
//*               BIND - BIND THE DB2 PACKAGE                        * 
//******************************************************************** 
//BIND     EXEC PGM=IKJEFT01,                                           
//             COND=(4,LT),                                             
//             REGION=4096K                                             
//STEPLIB  DD  DISP=SHR,                                               
//             DSN=XXX4.DB2.XXXX.XXXXLOAD                               
//DBRMLIB  DD  DISP=SHR,                                               
//             DSN=DEV.userid.DBRM(DB2PROG)    <---------------  (6)       
//SYSPRINT DD  SYSOUT=*                                                 
//SYSTSPRT DD  SYSOUT=*                                                 
//SYSUDUMP DD  SYSOUT=*                                                 
//SYSTSIN  DD  *                                                       
DSN SYSTEM (DEVDB   )                                                       
BIND  MEMBER    (DB2PROG) -                                             
      PACKAGE   (PACKG11) -                                           
      LIBRARY   ('DEV.userid.DBRM') -         <---------------- (7)                       
      ACTION    (REP) -                                                 
      ISOLATION (CS) -                                                 
      VALIDATE  (BIND)-                                                 
      RELEASE   (COMMIT) -     
      OWNER     (userid) -                                             
      QUALIFIER (DEVQUALI)                                               
END                                                                     
/*                                                                     
**************************** Bottom of Data ****************************


(1)  -  When we precompile, precompiler will create the DBRM, it will
        be placed in the pds specified here.

(2)  -  Location of COBOL-DB2 program

(3)  -  Needs to speficiy DCLGEN member locations

(4)  -  Needs to specify DCLGEN and COPYBOOK locations here

(5)  -  Load module location, load module will be created here. this
        location needs to be given in run jcl.

(5) & (6) - specify the location of DBRM, ( same location used in step1 ).



Back to top
View user's profile Send private message
jle1966

New User


Joined: 11 Jun 2009
Posts: 3
Location: Brussels

PostPosted: Thu Jan 21, 2010 3:37 pm
Reply with quote

Sorry, not really.
This is just an example of precompilation.
There is only 1 step for db2 and Cobol with the preprocessor. What if db2 dclgen and a cobol copybook have the same name in that case?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jan 21, 2010 8:47 pm
Reply with quote

Hello and welcome to the forum,

You need to talk with your system and/or database support. They can tell you the "rules" for working in your environment. You should NOT use jcl, parms, etc gotten from some forum - you should use the standard tools available on your system.

Quote:
What if db2 dclgen and a cobol copybook have the same name in that case?
Suggest you run a small test. . . Keep in mind that while the names might be the same, they are handled differently (include versus copy) and they are processed in different parts of the job. . .
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Thu Jan 21, 2010 10:00 pm
Reply with quote

I "believe" that the question is in regards to using the DB2 CO-Processor built in to Enterprise COBOL, not the DB2 PRE-Processor. When using the CO-Processor, there is no PRE-Processor step, all of the work is done in the COMPILE step.

From what I could find:

"An SQL INCLUDE statement is treated identically to a native COBOL COPY statement (including the search path and the file extensions used) when you use the SQL compiler option."

Ergo - my answer would be that you cannot have separate SYSLIB statements for INCLUDEs vs. COPYs.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jan 21, 2010 10:17 pm
Reply with quote

Hello,

Quote:
my answer would be that you cannot have separate SYSLIB statements for INCLUDEs vs. COPYs.
Yup. If it is all in one step. . .

IMHO, good standards would prevent the name duplication. . . icon_confused.gif
Back to top
View user's profile Send private message
jle1966

New User


Joined: 11 Jun 2009
Posts: 3
Location: Brussels

PostPosted: Mon Jan 25, 2010 1:52 pm
Reply with quote

@Ronald: thanks.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts CICS precompiler option used in Non C... CICS 2
No new posts Precompiler errors - Passing host var... DB2 3
No new posts Pro COBOL precompiler error All Other Mainframe Topics 4
No new posts JCL Error from DB2 Precompiler JCL & VSAM 12
No new posts Why does the precompiler fetch copybo... Mainframe Interview Questions 2
Search our Forums:

Back to Top