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

Calling difference between SUBPGM and PROC in PL/I


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
devidas-patil

New User


Joined: 08 Jan 2007
Posts: 54
Location: pune

PostPosted: Wed Jan 31, 2007 12:36 pm
Reply with quote

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
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Wed Jan 31, 2007 3:31 pm
Reply with quote

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
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Wed Jan 31, 2007 3:44 pm
Reply with quote

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
View user's profile Send private message
daredevil

New User


Joined: 30 Dec 2005
Posts: 9

PostPosted: Thu Feb 01, 2007 9:42 am
Reply with quote

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
View user's profile Send private message
devidas-patil

New User


Joined: 08 Jan 2007
Posts: 54
Location: pune

PostPosted: Thu Feb 01, 2007 4:20 pm
Reply with quote

Hi thanks a lot for your replies
Back to top
View user's profile Send private message
satya123
Warnings : 1

New User


Joined: 18 Aug 2006
Posts: 57

PostPosted: Wed Jul 18, 2007 1:59 pm
Reply with quote

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
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Fri Jul 20, 2007 3:55 pm
Reply with quote

Did you check if SUB2 object is in the syslib library?
Back to top
View user's profile Send private message
satya123
Warnings : 1

New User


Joined: 18 Aug 2006
Posts: 57

PostPosted: Fri Jul 20, 2007 4:54 pm
Reply with quote

Hi,
Thanks for reply...


NO syslib does not have the compiled member

What to do???next

satya123
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Sun Jul 22, 2007 2:57 pm
Reply with quote

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
View user's profile Send private message
satya123
Warnings : 1

New User


Joined: 18 Aug 2006
Posts: 57

PostPosted: Mon Jul 23, 2007 5:15 pm
Reply with quote

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
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Mon Jul 23, 2007 7:09 pm
Reply with quote

Does your CEE.SCEELKED contain the load of SUB2?
Back to top
View user's profile Send private message
satya123
Warnings : 1

New User


Joined: 18 Aug 2006
Posts: 57

PostPosted: Tue Jul 24, 2007 2:09 pm
Reply with quote

i checked but did not find sub2
Back to top
View user's profile Send private message
anbesivam

New User


Joined: 22 Aug 2006
Posts: 5

PostPosted: Wed Jul 25, 2007 7:21 pm
Reply with quote

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
View user's profile Send private message
satya123
Warnings : 1

New User


Joined: 18 Aug 2006
Posts: 57

PostPosted: Thu Jul 26, 2007 12:59 pm
Reply with quote

THANKS A LOT FOR YOUR HELP.......


SATYA123
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 -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Calling Java method from batch COBOL ... COBOL Programming 5
No new posts Calling an Open C library function in... CICS 1
No new posts Timestamp difference and its average ... DB2 11
No new posts Difference when accessing dataset in ... JCL & VSAM 7
Search our Forums:

Back to Top