View previous topic :: View next topic
Author
Message
devidas-patil New User Joined: 08 Jan 2007Posts: 54 Location: pune
hi friend,
can someone tell me difference between the calling subprogram and proc. like we use CALL in COBOL to call the subpgm.
Example: sproc1 is my procedure sio i will call it as
CALL SPROC
BUT if subpgm is stored somewhere in other pds
then how to call it in PL/I pgm.
Back to top
Bitneuker CICS Moderator Joined: 07 Nov 2005Posts: 1104 Location: The Netherlands at Hole 19
You can call a piece of code which is defined within your mainproc and you can call an external module (is it's own proc) which you declare in the caller as entry. Sample:
Code:
TPQAVER: PROC OPTIONS(MAIN);
DCL DEDAVPX ENTRY;
CALL UP_AUFBAUEN_QTPPCBS;
UP_AUFBAUEN_QTPPCBS:PROC;
END UP_AUFBAUEN_QTPPCBS;
CALL DEDAVPX (P1,P2,P3);
END TPQAVER;
DEDAVPX: PROC(P1,P2,P3) REORDER;
END DEDAVPX;
Back to top
Bitneuker CICS Moderator Joined: 07 Nov 2005Posts: 1104 Location: The Netherlands at Hole 19
Clarified it a bit..........
Code:
TPQAVER: PROC OPTIONS(MAIN); <-- main program start
DCL DEDAVPX ENTRY; <--- external proc to be called
CALL UP_AUFBAUEN_QTPPCBS; <--- internal proc called
UP_AUFBAUEN_QTPPCBS:PROC; <--- start internal proc
END UP_AUFBAUEN_QTPPCBS; <--- end internal proc
CALL DEDAVPX (P1,P2,P3); <-- call of external proc
END TPQAVER; <-- main program end
DEDAVPX: PROC(P1,P2,P3) REORDER; <-- start external proc
END DEDAVPX; <-- end external proc
Back to top
daredevil New User Joined: 30 Dec 2005Posts: 9
Hi ,
when you have the sub program coded in another PDS , During the Linking process , you have to give a link card which gives the list of object modules cluped in top make a Load module.
So when you are running a PL1 Load which consist of 2 program ,1 main and i sub program , since you have created the load clupping both the object modules, the program will run fine.
During the linking process, if you have not specidfied the library where the object module exist correctly, then the linkage step will fail and no load willbe created.
Thanks
Daredevil
Back to top
devidas-patil New User Joined: 08 Jan 2007Posts: 54 Location: pune
Hi thanks a lot for your replies
Back to top
satya123 Warnings : 1 New User Joined: 18 Aug 2006Posts: 57
hi
Somebody ! Please help me
How to call subprogram from mainprogram ?????
What i did are the steps.............with program and its compile jcl.........
step-1 ---- compiling the subprogram first
SUB2:PROCEDURE OPTIONS(MAIN);
DCL A FIXED BIN EXT;
A=200;
PUT SKIP LIST('INSIDE SUB2',A);
END SUB2;
with following JCL
//DOPROC EXEC PROC=PLICOMP
//PLI.SYSIN DD DSN=X.PLI.JCL(SUB2),DISP=SHR
//LKED.SYSLMOD DD DSN=X.PLI.LOAD(SUB2),DISP=SHR
//LKED.SYSLIB DD
// DD DSN=X.PLI.OBJ,DISP=SHR
//*
//
step-2 ------compiling the main program next
Main Program is
SEC1:PROCEDURE OPTIONS(MAIN);
DCL SUB2 EXTERNAL ENTRY;
SUB:PROCEDURE;
DCL A FIXED BIN EXT;
A=100;
PUT SKIP LIST('INSIDE SUB',A);
END SUB;
/* */
CALL SUB;
CALL SUB2;
END SEC1;
with following JCL
//DOPROC EXEC PROC=PLICOMP
//PLI.SYSIN DD DSN=X.PLI.JCL(SEC1),DISP=SHR
//LKED.SYSLMOD DD DSN=X.PLI.LOAD(SEC1),DISP=SHR
//LKED.SYSLIB DD
// DD DSN=X.PLI.OBJ,DISP=SHR
//*
//
WHEN I SUBMIT THIS IT IS SHOWING follwing error
IEW2456E 9207 SYMBOL SUB2 UNRESOLVED. MEMBER COULD NOT BE INCLUDED FROM THE DESIGNATED CALL LIBRARY
IEW2638S 4321 AN EXECUTABLE VERSION OF MODULE SEC1 EXISTS AND CANNOT BE REPLACED BY THE NON-EXECUTABLE MODULE JUST
CREATED.
IEW2008I 0F03 PROCESSING COMPLETED. RETURN CODE = 12.
thanks please guide me
Back to top
Bitneuker CICS Moderator Joined: 07 Nov 2005Posts: 1104 Location: The Netherlands at Hole 19
Did you check if SUB2 object is in the syslib library?
Back to top
satya123 Warnings : 1 New User Joined: 18 Aug 2006Posts: 57
Hi,
Thanks for reply...
NO syslib does not have the compiled member
What to do???next
satya123
Back to top
Bitneuker CICS Moderator Joined: 07 Nov 2005Posts: 1104 Location: The Netherlands at Hole 19
So it's no wonder you get these messages. The linker could not locate the object to include. Check your x.pli libraries where sub2 is located and concatenate that library. How does your plicomp proc look like?
Back to top
satya123 Warnings : 1 New User Joined: 18 Aug 2006Posts: 57
Hi George,
Really greatful for reply.........
Our PLICOMP is as follows...please guide me whether any changes have to be taken......
//PLICOMP PROC LNGPRFX='IEL320',LIBPRFX='CEE',
// SYSLBLK=3200,GOPGM=GO
//PLI EXEC PGM=IBMZPLI,PARM='SOURCE,OPTIONS,GOSTMT,GONUMBER,
// OBJECT',REGION=512K
//STEPLIB DD DSN=&LNGPRFX..SIBMZCMP,DISP=SHR
// DD DSN=&LIBPRFX..SCEERUN,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSLIN DD DSN=&&LOADSET,DISP=(MOD,PASS),UNIT=SYSDA,
// SPACE=(TRK,(3,3)),DCB=(LRECL=80,BLKSIZE=&SYSLBLK)
//SYSUT1 DD DSN=&&SYSUT1,UNIT=SYSDA,
// SPACE=(1024,(200,50),,CONTIG,ROUND),DCB=BLKSIZE=1024
//LKED EXEC PGM=HEWL,COND=(9,LT,PLI),REGION=512K
//SYSLIB DD DSN=&LIBPRFX..SCEELKED,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSLIN DD DSN=&&LOADSET,DISP=(OLD,DELETE)
// DD DDNAME=SYSIN
//SYSLMOD DD DSN=&&GOSET(&GOPGM),DISP=(MOD,PASS),UNIT=SYSDA,
// SPACE=(1024,(50,20,1))
//SYSUT1 DD DSN=&&SYSUT1,UNIT=SYSDA,SPACE=(1024,(200,20)),
// DCB=BLKSIZE=1024
//SYSIN DD DUMMY
Thanks
Satya123
Back to top
Bitneuker CICS Moderator Joined: 07 Nov 2005Posts: 1104 Location: The Netherlands at Hole 19
Does your CEE.SCEELKED contain the load of SUB2?
Back to top
satya123 Warnings : 1 New User Joined: 18 Aug 2006Posts: 57
i checked but did not find sub2
Back to top
anbesivam New User Joined: 22 Aug 2006Posts: 5
Hi satya123
Change your Link step as follows:
Code:
//LINK EXEC PGM=HEWL, *** LINK-EDIT COMPONENT ONE
// COND=(4,LT),REGION=5M,
// PARM=('COMPAT=LKED,XREF,LIST,MAP,REUS(SERIAL)',
// 'LET,SIZE=(3500K,960K),XCAL')
//*
//SYSLIB DD DISP=SHR,DSN=CEE.SCEELKED
// DD DISP=SHR,DSN=ISP.SISPLOAD
// DD DISP=SHR,DSN=SYS9.CRYPTO
// DD DISP=SHR,DSN=GDDM@.DIV.P0.LOAD
// DD DISP=SHR,DSN=SYS1.CSSLIB
// DD DISP=SHR,DSN=<----- Your Sub Programs Load Module Dataset----->
//SYSLIN DD DISP=SHR,DSN=&&LOADSET
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSLMOD DD DISP=(SHR),DSN=<------Main programs load module dataset----->(CALLING)
//*------------------------------------------
//*- RUN PROCESS -
//*------------------------------------------
//RUN EXEC PGM=CALLING,COND=((4,LT,LINK),(4,LT,COMPILE))
//STEPLIB DD DSN==<------Main programs load module dataset----->,DISP=SHR
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
Hope this helps...
Back to top
satya123 Warnings : 1 New User Joined: 18 Aug 2006Posts: 57
THANKS A LOT FOR YOUR HELP.......
SATYA123
Back to top
Please enable JavaScript!