Page 1 of 1

variables from as400

Posted: Fri Jun 17, 2011 9:29 am
by monahanks
it is possible to use RUNPROJECT from a CLLE on the as400 to run a goanywhere project, passing a variable to the project. is it possible to receive a variable back into the CLLE from the project? for example, if i execute RUNPROJECT passing a variable named 'error' with a value of 'false', and in the project that variable is changed to 'true ' on an error, can that value 'true ' be passed back to the CLLE and used as a condition in the CLLE?

Re: variables from as400

Posted: Fri Jun 17, 2011 11:27 am
by Support_Julie
You cannot return variables values from RUNPROJECT to a CL program.

You can however, write to a Data Area and then retrieve that value in a project using the exec400 command to execute the rtvdata command.

Re: variables from as400

Posted: Fri Jun 17, 2011 1:20 pm
by monahanks
Thanks Julie. Using your suggestion, I created a CLLE that is executed from the GA project to change a data area, and I retrieve that data area into my CLLE to test if the project ended with an error.
For others' information, we use the Variables parameter in the RUNPROJECT to pass variable data into a GA project.

Re: variables from as400

Posted: Fri Mar 06, 2015 5:17 pm
by Awebb Reeds
Mona, would you possibly be willing to show me the steps for getting that data area back from your CL and how it's set in the project itself? I've tried doing this a million ways and cannot seem to get any data...

Re: variables from as400

Posted: Thu May 14, 2015 2:30 pm
by monahanks
Hi, sorry for the late reply - I haven't hit the forum in a while.
In my GA project I call my CLLE (named @UTL878C below) and pass variables containing necessary library names for the application environment and the actual data area name. In my project I set the variable ${DataField} with the actual value and send it to the CLLE. The CLLE does the actual populating of the data area.
On the IBMi I call the project passing the variable to GA.

<exec400 label="populate_dtaara" resourceId="CMRG400" version="1.0" executeOnlyIf="${Failed eq NO}">
<program name="@UTL878C" library="${programlib}">
<parameter label="FileNbr" value="${NbrATSFiles}" dataType="text" length="1" usage="inout" />
<parameter label="dtara" value="${dtara}" dataType="text" length="10" usage="inout" />
<parameter label="filelib" value="${filelib}" dataType="text" length="10" usage="inout" />
<parameter label="DataField" value="${DataField}" dataType="text" length="100" />
</program>
</exec400>

HTH, let me know if this doesn't answer your question.