Sorry, but WHEN command works only after CALL/LOADGO TSO commands, not after
CALL DSN subcommand.

Karol Filipowicz

2011/2/10 Steve Comstock <[email protected]>

>  On 2/9/2011 2:07 AM, karolf Gazeta.pl wrote:
>
>>  Hi!
>>
>>
>> I have a Rexx script where I run DB2 applications by DSN+CALL commands:
>>
>>  ret_codes.=''
>>  do i=1 to ....
>>    .....
>>   q1 =  " RUN  PROGRAM("pgmname") PLAN("planname") "
>>   q2 =  " PARM('"parm_txt"')"
>>   queue (q1)(q2)
>>   queue " END "
>>   "DSN  SYSTEM(DB2X)"
>>   ret_codes.pgm.i=pgmname
>>   ret_codes.plan.i=planname
>>   ret_codes.retcode.i=RC
>>   'DELSTACK'
>>  end
>>
>>  The above solution is bad from performance's point of view.
>>  Best solution would be to build the stack and then run DSN command only
>> once:
>>
>>   do i=1 to ....
>>    .....
>>   q1 =  " RUN  PROGRAM("pgmname") PLAN("planname") "
>>   q2 =  " PARM('"parm_txt"')"
>>   queue (q1)(q2)
>>  end
>>  queue " END "
>>  "DSN  SYSTEM(DB2X)"
>>  'DELSTACK'
>>
>>  The thread will be created only once. But there is one difficulty. I
>> don't
>> know how to take over return codes of all
>>  running programs (but the last).
>>  Anybody knows the solution? (or address where TSO saves RC after running
>> CALL program).
>>
>>  regards
>>
>>  Karol Filipowicz
>>
>
> TSO doesn't save all the RCs. Remember, when you queue commands
> those commands are not run until after the exec ends!
>
> Since the DSN command runs under TSO as a command processor,
> perhaps you could queue some WHEN commands (I don't know if
> WHEN commands will work after DB2 subcommands, but it might
> be worth a try). Maybe:
>
>  queue when sysrc(= 0) se 'return from job 1 successful' u(*)
>  queue (q1) (q2)
>
>
> WHEN commands are documented for use after TSO CALL, so I
> don't know if this will work; also, you might have to put
> the send command in a REXX exec or CLIST to make it work.
>
> Bit of a stretch. Let me know how that works, if at all.
>
>
>
> --
>
> Kind regards,
>
> -Steve Comstock
> The Trainer's Friend, Inc.
>
> 303-393-8716
> http://www.trainersfriend.com
>
> * To get a good Return on your Investment, first make an investment!
>  + Training your people is an excellent investment
>
> * Try our new tool for calculating your Return On Investment
>    for training dollars at
>  http://www.trainersfriend.com/ROI/roi.html
>
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: GET IBM-MAIN INFO
> Search the archives at http://bama.ua.edu/archives/ibm-main.html
>

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to