Unfortunately I'm having the pleasure of working with s/36 stuff...OLD all 99 RPG indicators used on one line of code type stuff & I feel your pain. A couple of notes regarding s/36, you don't HAVE to call a CL to STRS36, that can be handled by the settings on the user profiles (and/or system value QSPCENV) within the OCL you can call any program be it RPG or CL program. For what you are attempting to do I'm not sure you'll be able to make that work out. s/36 is a finicky beast to say the least. Also MONMSG will not always be able to trap errors that occur in the OCL proc so you could end up with OCL/SSP messages that result in additional CL/OS messages and it can be a bear to deal with. My recommendation may or may not be feasible with what you are trying to accomplish but if possible have the originating OCL call the RPG directly & return back to that OCL to execute the other proc.
Thanks,
Tommy Holden
Please note new email address tommy.holden@xxxxxxxxx
-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Les Mittman
Sent: Monday, February 22, 2016 12:44 PM
To: midrange-l@xxxxxxxxxxxx
Subject: Can a S/36 Procedure be run within a CL program within a S/36 process?
Hi All,
I recently started working with a company that has an iSeries that is running S/36 code. Once the User signs on, a CL is called that runs the STRS36 command and then their S/36 software application menu is displayed. The application software uses OCL and RPG though it does incorporate a few CL procedures to call KeyesMail commands that will send e-mail from within the application.
This company is not yet prepared to rewrite (i.e. convert) their software to native iSeries so I am trying to work within the current environment, but to provide some additional functionality. I am making some program enhancements and I am running into a problem and I would like to know if there is an easy way to overcome it.
I have found that from the command line or from a menu, you can run S/36 OCL and within the OCL, you can call CL programs and run iSeries native RPG programs.Also, you can call a CL program and then run a OCL procedure using the STRS36PRC procedure.
My problem is that I have a need to run a S/36 OCL from within a CL program that was originally called from a S/36 OCL.That is,
- A S/36 OCL starts the Invoicing process. - Within this OCL, I am calling a CL program that will run a new Invoice e-mailing process. - The CL program uses the CALL command which calls an iSeries RPG program. - Within this RPG program, I call a CL program in which I want to run an existing OCL procedure. - To run this OCL procedure, I was going to use the STRS36PRC command. However, I get an error message that it is not allowed within this process.
Based on my research, when a S/36 OCL process has started, you can run a CL program, but you cannot then run another S36 OCL from within the CL program. The error message is below.
Additional Message Information Message ID . . . . . . : CPA0701 Severity . . . . . . . : 99 Message type . . . . . : Inquiry Date sent . . . . . . : 02/16/16 Time sent . . . . . . : 15:57:12 Message . . . . : SSP0142 received by CLBILLEPC1 at 2600. (C DI R) Cause . . . . . : Control language (CL) program CLBILLEPC1 inlibrary BSILIB detected an error at statement number 2600.Message text for SSP0142 is: S/36 environment function not allowed orerror in command. Recovery . . . : This inquiry message canbe avoided by changing the program. Monitor for the error (MONMSGcommand) and perform error recovery within the program. To continue, choose areply value. Possible choices for replying to message . . .. . . . . . . . . . . . : C -- Cancel the CL program. D -- Dump the CL program variables andcancel the CL program. I -- Ignore the failing command. R -- Try the failing command again. Bottom Press Enter to continue. F3=Exit F6=Print F9=Display messagedetails F10=Display messages in job log F12=Cancel F21=Select assistance level
Is there some other way to perform the process that I am trying to run?
If not, then it seems that my only choice to rewrite the last section that is in OCL as an iSeries CL procedure with iSeries RPG programs. Is that my only option?
I would appreciate any suggestions or direction.
Thanks very much.
Les Mittman
Cell: 847-858-5235
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at
http://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
As an Amazon Associate we earn from qualifying purchases.