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

dynamic call in PLI using fetch cause error


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

New User


Joined: 21 Sep 2009
Posts: 51
Location: china

PostPosted: Wed May 12, 2010 4:55 pm
Reply with quote

I am testing the dynamic call in PLI using FETCH:
the main program:
Code:
MAINPGM:PROC OPTIONS(MAIN);
  DCL SUBPGM EXTERNAL;     
  FETCH SUBPGM;           
  CALL SUBPGM;             
  RELEASE SUBPGM;         
END MAINPGM; 

the routine:
Code:
SUBPGM: PROC;                     
  PUT SKIP LIST('THE SUBPROGRAM');
END SUBPGM;   


and when compile and link-edit routine,I followed the programming guide to add the link parameter DYNAM=DLL,but no for main program.

And in the programming guide,it indicates that :
[i][i]1. OPTIONS(FETCHABLE) should be specified on the PROCEDURE statement for the entry point of any PL/I routine to be FETCHed.
2. Unless the NORENT option has been specified, the ENTRY declaration in the routine that FETCHes must not specify OPTIONS(COBOL) or
OPTIONS(ASM)—these should be specified only for COBOL or ASM routines not linked as DLLs.
3. OPTIONS(FETCHABLE) must be specified on the PROCEDURE statement for the entry point of the FETCHABLE routine or the procedure must be compiled with the DLLINIT option.
4. Unless the NORENT option has been specified, a PROCEDURE specifiying
OPTIONS(FETCHABLE) must be linked as a DLL.
[/i][/i]

but I don't where to place OPTIONS(FETCHABLE),so I run the main progam and get the error like:
ABENDED S000 U4038
CEE3362S No main or fetchable procedure or function was present within the load module.


Could someone give me help to make the test successfully?
Back to top
View user's profile Send private message
donateeye
Warnings : 2

New User


Joined: 01 Jun 2007
Posts: 62
Location: chennai

PostPosted: Wed May 12, 2010 5:44 pm
Reply with quote

I guess here :

SUBPGM: PROC OPTIONS(FETCHABLE);
PUT SKIP LIST('THE SUBPROGRAM');
END SUBPGM;
Back to top
View user's profile Send private message
satish.ms10

Active User


Joined: 10 Aug 2009
Posts: 184
Location: India

PostPosted: Wed May 12, 2010 8:36 pm
Reply with quote

Subprogram should be define like below.

Code:
SUBPGM: PROC OPTIONS(FETCHABLE);
PUT SKIP LIST('THE SUBPROGRAM');
END SUBPGM;


This code I have tested and it worked.

I am not sure why this need to be declared like this.

I am getting this question because there are so many subprograms FETCHed and CALLed without specifying FETCHABLE option in their definition in my shop.

Can anyone provide more information on this, please.

Thanks!
Back to top
View user's profile Send private message
henry888

New User


Joined: 21 Sep 2009
Posts: 51
Location: china

PostPosted: Wed May 12, 2010 9:31 pm
Reply with quote

satish.ms10 wrote:
Subprogram should be define like below.

Code:
SUBPGM: PROC OPTIONS(FETCHABLE);
PUT SKIP LIST('THE SUBPROGRAM');
END SUBPGM;


This code I have tested and it worked.

I am not sure why this need to be declared like this.

I am getting this question because there are so many subprograms FETCHed and CALLed without specifying FETCHABLE option in their definition in my shop.

Can anyone provide more information on this, please.

Thanks!


hi satish,

Could you provide that any special PARMs you used when you compile and link-edit the two programs?

Or when compile and link-edit the two programs any special thing we should take care of?

Many thanks
Back to top
View user's profile Send private message
henry888

New User


Joined: 21 Sep 2009
Posts: 51
Location: china

PostPosted: Thu May 13, 2010 8:18 am
Reply with quote

and when I compile and link-edit the SUBPGM,
Code:
SUBPGM: PROC OPTIONS(FETCHABLE);
PUT SKIP LIST('THE SUBPROGRAM');
END SUBPGM;

error generated like:
SEVERE AND ERROR DIAGNOSTIC MESSAGES

IEL0335I S 1 INVALID ITEM IN 'OPTIONS' LIST. 'FETCHABLE' IGNORED.


I don't know why...
Back to top
View user's profile Send private message
henry888

New User


Joined: 21 Sep 2009
Posts: 51
Location: china

PostPosted: Thu May 13, 2010 1:17 pm
Reply with quote

the issue is worked out,just replace the compiler with the new version
Back to top
View user's profile Send private message
donateeye
Warnings : 2

New User


Joined: 01 Jun 2007
Posts: 62
Location: chennai

PostPosted: Thu May 13, 2010 3:27 pm
Reply with quote

Great but, did you had that FETCHABLE mentioned in the OPTIONs?
Back to top
View user's profile Send private message
henry888

New User


Joined: 21 Sep 2009
Posts: 51
Location: china

PostPosted: Thu May 13, 2010 3:37 pm
Reply with quote

yes...of course
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: Fri May 14, 2010 4:47 am
Reply with quote

Hello,

Quote:
the issue is worked out,just replace the compiler with the new version
Is there some reason you did not use the standard compile jcl that points to the correct compiler? Programmers should not pick&choose which compiler they will use.

In well-managed organizations, this behavior is not tolerated and has even caused people to be terminated. . . The risk is simply too great.

Not a threat - just a caution. . .
Back to top
View user's profile Send private message
henry888

New User


Joined: 21 Sep 2009
Posts: 51
Location: china

PostPosted: Fri May 14, 2010 7:17 am
Reply with quote

dick scherrer wrote:
Hello,

Quote:
the issue is worked out,just replace the compiler with the new version
Is there some reason you did not use the standard compile jcl that points to the correct compiler? Programmers should not pick&choose which compiler they will use.

In well-managed organizations, this behavior is not tolerated and has even caused people to be terminated. . . The risk is simply too great.

Not a threat - just a caution. . .


Hi Dick,

Thanks for your really kind reminder...

The codes just run in the development environment and just for learning,will not be used in production...
What I want to say is that when using the Dynamic Call(FETCH) maybe the high lelvel version of compiler should be used because in some low versions this feature is not supported...
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: Fri May 14, 2010 8:37 am
Reply with quote

You're welcome - thanks for the clarification icon_smile.gif

Possibly the different versions of the compiler have been set up with different defaults? I don't "do" pl/i, so that is just a guess. . .

d
Back to top
View user's profile Send private message
henry888

New User


Joined: 21 Sep 2009
Posts: 51
Location: china

PostPosted: Fri May 14, 2010 8:44 am
Reply with quote

it can be said different versions of compiler have different compiler options,and the dynamic call option is not implemented in the old version... icon_rolleyes.gif
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Fri May 14, 2010 12:54 pm
Reply with quote

henry888 wrote:
it can be said different versions of compiler have different compiler options,and the dynamic call option is not implemented in the old version... icon_rolleyes.gif


Bull excrement!

PL/I has supported FETCH since at least the old V1.5 OS compiler in the mid 1980'ies. At the time fetched modules had a few restrictions, but it was there, so don't make statements that have no basis in fact!
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri May 14, 2010 12:58 pm
Reply with quote

PL1 was a great language until polluted with windoze and Cish terms like DLL and similar icon_biggrin.gif
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Fri May 14, 2010 1:43 pm
Reply with quote

enrico-sorichetti wrote:
PL1 was a great language until polluted with windoze and Cish terms like DLL and similar icon_biggrin.gif


The thing is, you can still use PL/I like it was used when designed in the early 1960's, nobody forces you to use any of the newer stuff, but in some cases it is pretty useful!

Anyway, name some of the C- and Windoze-isms that, according to you, should not be in PL/I, and maybe some things that aren't in the language, but should be!

And let's not start a language war, I'm also a full blooded PL/I (and REXX) guy - no C for me!
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 Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts Fetch data from programs execute (dat... DB2 3
Search our Forums:

Back to Top