View Full Version : Calling a RPG36 program from CL
09-28-2004, 10:35 AM
Without starting 36 env, try using: STRS36PRC PRC(COL019) This assumes that the procedure is in #LIBRARY, there is a parameter for library and for parameters. -dan
09-28-2004, 10:45 AM
Dan, I tried that and got the message "Procedure COL019 not found". COL019 is a "program" not a "procedure".
09-28-2004, 11:26 AM
S/36 programs should be LOADed via OCL rather than CALLed. Create a source file and name it QS36PRC. Create a member less eight characters or less. The syntax for S/36 programs is as follows:<tt><big> // LOAD xxxxx // FILE NAME-yyyyy // RUN</tt></big> Once you have established the S36 procedure, you can then use STRS36PRC to run the procedure from CL. Dave
09-28-2004, 11:33 AM
Sorry, wasn't thinking. The STRS36PRC PRC parameter does not allow a program name, while the STRS36 PRC parameter does. Try: STRS36 PRC(COL019) CURLIB(??) If that doesn't work, do a WRKOBJ *ALL/COL019. Is it still in #LIBRARY? Or in another library not in your library list? -dan
09-28-2004, 11:46 AM
I am in the initial stages of converting OCL to CL. I tried to write a CL to call a RPG36 program and it failed. It said that I needed to be in the 36 environment. No problem, I ran STRS36. I continue to get the message. It is "RPG program COL019 must run from a S/36 environment job." Now, I thought that since the program COL019 was compiled and the object resided in the library, that I would be able to "Call" it. I want to get this working first so I know what I will need to do the rest of the conversions. Here is the coding that I had. The original code is at the bottom and edited out. Thank You Harold ************************************************** **************** pgm DCL VAR(&DSPNAM) TYPE(*CHAR) LEN(10) DCL VAR(&file) TYPE(*CHAR) LEN(10) DCL VAR(&vwno) TYPE(*CHAR) LEN(4) rtvjoba job(&dspnam) CHGVAR VAR(&FILE) VALUE('w.' || &DSPNAM |< 'VWNO') OVRDBF FILE(WORK) TOFILE(&file) OVRDBF FILE(Wrkordr) TOFILE(*LIBL/W.wkordr) call col019 /* // LOAD COL019 */ /* // FILE NAME-WORK,LABEL-W.?WS?VWNO */ /* // FILE NAME-WRKORDR,LABEL-W.WKORDR,DISP-SHRRM */ /* // RUN */ endpgm
09-28-2004, 11:46 AM
There already is an OCL to call the program COL019. What I am wanting to do is convert the OCL to CL and not change the RPG36 program yet. Do I have to convert the RPG program first, then convert the OCL?
09-28-2004, 01:03 PM
Hcolumber2 wrote: > > There already is an OCL to call the program COL019. What I am wanting to do is convert the OCL to CL and not change the RPG36 program yet. > > Do I have to convert the RPG program first, then convert the OCL? Yes, you have to convert the program if you want to use "call". Once I tried to get around this by calling the RPG36 program from a CLP, but that doesn't work - you have to use // LOAD // RUN to call the CLP (or any other language) if the program wants to call a 36 program.
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.