View previous topic :: View next topic
|
Author |
Message |
henry888
New User
Joined: 21 Sep 2009 Posts: 51 Location: china
|
|
|
|
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 |
|
|
donateeye Warnings : 2 New User
Joined: 01 Jun 2007 Posts: 62 Location: chennai
|
|
|
|
I guess here :
SUBPGM: PROC OPTIONS(FETCHABLE);
PUT SKIP LIST('THE SUBPROGRAM');
END SUBPGM; |
|
Back to top |
|
|
satish.ms10
Active User
Joined: 10 Aug 2009 Posts: 184 Location: India
|
|
|
|
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 |
|
|
henry888
New User
Joined: 21 Sep 2009 Posts: 51 Location: china
|
|
|
|
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 |
|
|
henry888
New User
Joined: 21 Sep 2009 Posts: 51 Location: china
|
|
|
|
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 |
|
|
henry888
New User
Joined: 21 Sep 2009 Posts: 51 Location: china
|
|
|
|
the issue is worked out,just replace the compiler with the new version |
|
Back to top |
|
|
donateeye Warnings : 2 New User
Joined: 01 Jun 2007 Posts: 62 Location: chennai
|
|
|
|
Great but, did you had that FETCHABLE mentioned in the OPTIONs? |
|
Back to top |
|
|
henry888
New User
Joined: 21 Sep 2009 Posts: 51 Location: china
|
|
|
|
yes...of course |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
henry888
New User
Joined: 21 Sep 2009 Posts: 51 Location: china
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
You're welcome - thanks for the clarification
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 |
|
|
henry888
New User
Joined: 21 Sep 2009 Posts: 51 Location: china
|
|
|
|
it can be said different versions of compiler have different compiler options,and the dynamic call option is not implemented in the old version... |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
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... |
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
PL1 was a great language until polluted with windoze and Cish terms like DLL and similar |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
enrico-sorichetti wrote: |
PL1 was a great language until polluted with windoze and Cish terms like DLL and similar |
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 |
|
|
|