From: Graham Hobbs on
Richard, Benjamin,
Thanks for the info and very good reference.
For my purposes am going with the errorlevel method.
Graham

On Tue, 02 Feb 2010 08:20:18 +0200, Binyamin Dissen
<postingid(a)dissensoftware.com> wrote:

>On Mon, 1 Feb 2010 18:59:49 -0800 (PST) Richard <riplin(a)Azonic.co.nz> wrote:
>
>:>On Feb 2, 2:55�pm, Graham Hobbs <gho...(a)cdpwise.net> wrote:
>:>> On Mon, 01 Feb 2010 22:27:35 +0200, Binyamin Dissen
>
>:>> <postin...(a)dissensoftware.com> wrote:
>:>> >On Mon, 01 Feb 2010 13:34:33 -0500 Graham Hobbs <gho...(a)cdpwise.net> wrote:
>
>:>> >:>I have a Windows XP script called abc.cmd running in a CMD window
>:>> >:>containing:
>
>:>> >:>cls
>:>> >:>call stepp01 %1 %2 %3 %4
>:>> >:>call drumaprep
>:>> >:>call drumb %2
>:>> >:>call drumc %1 %3 %4
>:>> >:>..etc
>
>:>> >:>It is called by running:
>
>:>> >:>c:\>abc clna cpybk01 vsam 24
>
>:>> >:>Upon invocation abc assigns the four parm values to %1 %2 %3 %4.
>:>> >:>Stepp01 is an IBM Cobol program that via Linkage Section validates
>:>> >:>these parms but finds that 'vsam' should be 'db2'.
>
>:>> >:>Question is:
>:>> >:>How do I change the value of %3 from vsam to db2 during the CMD
>:>> >:>execution so when drumc is called it gets the right info?
>:>> >:>Is there a 'standard'?
>
>:>> Benjamin, thanks for your comments:-)
>
>:>> >Don't.
>
>:>> Why don't?
>:>> Do you know if it can be done?
>
>Because it is unclean, even if possible. Only change names variables.
>
>:>> >If STEPP01 determines the type, it should just set a variable and that
>:>> >variable should be used in the script. You can also use the exit code.
>
>:>> In Cobol I can set RETURN-CODE to a value and test it via errorlevel.
>
>That looks like the approach. Set a named variable to a value based on the
>errorlevel.
>
>:>> Also I can set a variable to DB2 in STEPP01 but how do I pass that
>:>> variable to my CMD environment. I thought Cobol's only skill in
>:>> returning stuff to a CMD window was the RETURN-CODE - yes/no?
>
>:>When you execute a program (or CALL) you create a new child shell with
>:>the environment copied from the parent. Changing the environment in
>:>the child has no effect on the parent so when the CALL returns the
>:>environment (and all the %x) is as it was before.
>
>:>http://stackoverflow.com/questions/774047/how-can-i-change-windows-shell-cmd-exe-environment-variables-from-c
>
>Didn't realize that Window$ didn't give an API to set a variable in the
>calling process.