Page 1 of 1

Executing multiple ISREDIT macros on particular condition.

PostPosted: Tue May 07, 2013 12:19 pm
by chinkump
Hi,

I have coded multiple ISREDIT command macros which needs to be run one after another. I am executing the macros by using the command below.
"ISPEXEC EDIT DATASET('TEST.TEST.PDS(TEST1)') MACRO(SF)"

Here I am executing the marco SF. Similar to this I have coded multiple macros as per requirement.Now I want to integrate all the mcros to a single macro based on the condition.

Lets say for example macro are SF,SG,SK,SL.
Now I want to execute then in sequence and if any of the macro fails then prceding macros should not be executed and it should exit. Suppose SF macro checks for the jobcard if it is correct then only macro SG will be executed orelse the whole macro should exit without executing further(no execution of SG,SK,SL macros).

Can anybody suggest how to achieve this condition in macros.

Thanks,
Chinkump

Re: Executing multiple ISREDIT macros on particular conditio

PostPosted: Tue May 07, 2013 1:29 pm
by Stefan
One solution would be to let the macros communicate with the driver program by ISPF variables in the pool.
Each macro should set the variabel EXITRC to a predefined value and VPUT it into the ISPF variable pool when processing is done.
So you can decide if you want to continue with the next macro or terminate the whole process.
macros = 'SF SG SK SL'
exitrc = 0
do i = 1 by 1 to words(macros) until exitrc <> 0
   mac = word(macros,i)
   "ISPEXEC EDIT DATASET('TEST.TEST.PDS(TEST1)') MACRO("mac")"
   "ISPEXEC VGET EXITRC"
end

Re: Executing multiple ISREDIT macros on particular conditio

PostPosted: Tue May 07, 2013 2:22 pm
by chinkump
Each macro should set the variable VPUT it into the ISPF variable pool when processing is done... can you please explain me this statement in detail?

Many thanx in advance.

Thanks,
Chinkump

Re: Executing multiple ISREDIT macros on particular conditio

PostPosted: Tue May 07, 2013 4:39 pm
by Akatsukami
chinkump wrote:Each macro should set the variable VPUT it into the ISPF variable pool when processing is done... can you please explain me this statement in detail?

At the end of each macro, include the line
address ispexec "VPUT EXITRC"

Read up on the ISPF variable (V*) services.