Executing multiple ISREDIT macros on particular condition.



TSO Programming, ISPF, SDF, SDSF and PDF, FTP, TCP/IP Concepts, SNA & SNA/IP etc...

Executing multiple ISREDIT macros on particular condition.

Postby chinkump » Tue May 07, 2013 12:19 pm

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
chinkump
 
Posts: 26
Joined: Fri Jan 20, 2012 10:48 pm
Has thanked: 3 times
Been thanked: 0 time

Re: Executing multiple ISREDIT macros on particular conditio

Postby Stefan » Tue May 07, 2013 1:29 pm

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
There are 10 types of people in the world: Those who understand binary, and those who don't.
User avatar
Stefan
 
Posts: 27
Joined: Tue Aug 21, 2012 3:02 pm
Has thanked: 0 time
Been thanked: 2 times

Re: Executing multiple ISREDIT macros on particular conditio

Postby chinkump » Tue May 07, 2013 2:22 pm

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
chinkump
 
Posts: 26
Joined: Fri Jan 20, 2012 10:48 pm
Has thanked: 3 times
Been thanked: 0 time

Re: Executing multiple ISREDIT macros on particular conditio

Postby Akatsukami » Tue May 07, 2013 4:39 pm

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.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times


Return to TSO & ISPF

 


  • Related topics
    Replies
    Views
    Last post