MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

VPUT & VGET commands
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Tue Jan 21, 2003 6:40 am    Post subject: VPUT & VGET commands Reply with quote

I am submitting a batch job from a rexx routine. After the job ends I need my processing further. So, inorder to find whether the job ends, I tried to use VPUT & VGET functions. What I did is that, before I invoke the batch job I populate some value say 'N' to some variable say (ENDIND) using VPUT. Then in the JCL, as a last step I call another small rexx routine which will change the ENDIND variable's value to 'Y'. In the meantime my main rexx routine will be constantly polling the variable (ENDIND) using VGET command and check whether its value is changed to 'Y'. But, it didn't work as I expected. ie the variable is not shared between the rexx & jcl jobs.

Can't we share a variable from different programs ? What is the scope of a variable which is populated by VPUT command (I tried ASIS & SHARED mode).

Please explain.
Back to top
View user's profile Send private message
warp5
Intermediate


Joined: 02 Dec 2002
Posts: 429
Topics: 18
Location: Germany

PostPosted: Tue Jan 21, 2003 7:14 am    Post subject: Reply with quote

You have to use the same profile dataset for both jobs. Try using VPUT/VGET with the PROFILE option.
Back to top
View user's profile Send private message Visit poster's website
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Tue Jan 21, 2003 7:40 am    Post subject: Reply with quote

Sorry, It does not work either.
Back to top
View user's profile Send private message
taltyman
JCL Forum Moderator
JCL Forum Moderator


Joined: 02 Dec 2002
Posts: 310
Topics: 8
Location: Texas

PostPosted: Tue Jan 21, 2003 9:13 am    Post subject: Reply with quote

I wouldn't think that you could share the same profile dataset between the batch job and your main rexx routine. Is your main routine a TSO session?
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Tue Jan 21, 2003 9:42 am    Post subject: Reply with quote

yes it is a TSO routine using PANELS...
Back to top
View user's profile Send private message
dorkhead
Beginner


Joined: 07 Jan 2003
Posts: 25
Topics: 0
Location: Lux

PostPosted: Tue Jan 21, 2003 10:35 am    Post subject: Reply with quote

you can't do that.
basically ur job and ur user does not have the same profile.
_________________
Dorkhead
Back to top
View user's profile Send private message Visit poster's website
miboy
Beginner


Joined: 10 Jan 2003
Posts: 13
Topics: 0

PostPosted: Tue Jan 21, 2003 5:35 pm    Post subject: Reply with quote

Batch job cannot use the same Profile dataset allocated to the ISPF session... so I guess ur idea will not work. Why not try writting ur flag in a file or something and take it from there

Miboy
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Tue Jan 21, 2003 9:46 pm    Post subject: Reply with quote

If all you are trying to do is to see if the job is still running, this will work from a TSO id:
Code:
/* REXX - submit a job and wait for it to end                        */
Call outtrap 'stem.',1000              /* Turn trapping on           */
'sub dgn.cntl(frank)'                  /* Submit and trap job id     */
Call outtrap 'off'                     /* Turn trapping off          */
Say '>>' stem.1                                                       
Parse Var stem.1 . 'JOB' id .          /* Extract job id from msg    */
Call syscalls 'ON'                     /* Allow Unix services for     
                                          Sleep                      */
Do Until pos('EXECUTING',stem.1) = 0   /* Loop utntil done           */
  Address syscall 'sleep 1'            /* Sleep for a second         */
  Call outtrap 'stem.',1000            /* Turn trapping on           */
  'STATUS 'id                          /* Get status                 */
  Call outtrap 'off'                   /* Turn trapping off          */
  Say '>>' stem.1                                                     
End                                                                   
Call syscalls 'OFF'                    /* Disable Unix services      */


Another way is to search control blocks for the job name, but if another job of the same name starts, you won't know that it is a different job unless you look for the job id and that gets tricky to make work on all levels of MVS.

You could write an indicator to a file, and read that but then you have synchronization problems and cleanup requirements if the job abends.
Back to top
View user's profile Send private message Visit poster's website
warp5
Intermediate


Joined: 02 Dec 2002
Posts: 429
Topics: 18
Location: Germany

PostPosted: Wed Jan 22, 2003 1:50 am    Post subject: Reply with quote

I think the best way would be to submit your job, end your rexx, and after the job is finished add a step that restarts your rexx with an indicator that you are in the second pass. That should solve your problems.
Back to top
View user's profile Send private message Visit poster's website
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Wed Jan 22, 2003 2:52 am    Post subject: Reply with quote

Sorry Warp. That's not possible as I'm using PANELS. Please see my previous posts on "Invoking Rexx routine from JCL".

Thanks
Back to top
View user's profile Send private message
taltyman
JCL Forum Moderator
JCL Forum Moderator


Joined: 02 Dec 2002
Posts: 310
Topics: 8
Location: Texas

PostPosted: Wed Jan 22, 2003 9:07 am    Post subject: Reply with quote

You could...
put a notify in the job card
set your tso profile nointercom
submit job
loop
trap the results of a listbc command
job finished?
verify its the correct job? yes exit loop, no sleep
end loop
reset profile to intercom
check trapped output for success/failure
process accordingly
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Wed Jan 22, 2003 10:48 am    Post subject: Reply with quote

That thread ended abruptly, but there is no reason you can't 'display' panels in batch. The only reason to do so is to take advantage of the panel logic in the panels and you have to be sure the program driving the panels will not sit on any one pane indefinitely because ISPF in batch just simulates an ENTER key when displaying panels but it is possible and even common to run panels in batch. They just never display anywhere.

I don't think this is a case where you want to do that... I just thought I"d point out that there is no prohibition against running an ISPF application in batch, as long as it is written to work that way.
Back to top
View user's profile Send private message Visit poster's website
taltyman
JCL Forum Moderator
JCL Forum Moderator


Joined: 02 Dec 2002
Posts: 310
Topics: 8
Location: Texas

PostPosted: Wed Jan 22, 2003 11:16 am    Post subject: Reply with quote

I shudder every time I see someone wanting to submit a batch job and then use a program to monitor that job for completion. A lot of cycles can be burned up. What if the program has to wait to start or has other problems?
The batch job, what does it do? Is it something that could be executed from the same TSO address space? For example ibm utilities, user written programs can be executed if you allocate the necessary dds/dsnames.
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Wed Jan 22, 2003 12:03 pm    Post subject: Reply with quote

I was going to say the same thing. This is a solution in search of a problem. Whatever problem is trying to be solved should be re-evaluated to see if this is the best way to do it. I've never heard of a situation where this is the best way. Almost anything that can run in batch can run online too, at least in the world of utilities. Convert the JCL to a rexx program and do it online if possible. Especially if you will be waiting for it to complete anyway.

I only answered the original question literally because it is an interesting thing to make work... not because I agree that it is a good solution. If you spend most of the time sleeping and not looping, cycles aren't too much of an issue, though swapping and task switching do have a negative affect on the overall system.
Back to top
View user's profile Send private message Visit poster's website
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Thu Jan 23, 2003 6:01 am    Post subject: Reply with quote

Hi Semigeezer & Taltyman,

Ofcourse I can do the batch operation in REXX, but the operation that I am trying is to do is a call to SUPERC search which searches a huge list of PDS and it is definitely a time consuming task. Unfortunately, I am a bit fascinated about GUI kind of stuff. So, I thought why not I call the SUPERC from a batch which will start executing in a separate THREAD type of thing and in the meanwhile I can display some Animation on screen. I know its silly, but I want animation.

Semigeezer, If I am not wrong, you say that we can display PANELS from batch. Will the panel be displayed on the Screen. When I tried once, I wasn't shown any panels and the batch job just went on without ending. Then I had to abruptly purge it. Can you please, elaborate on this.

Taltyman, you were saying something about some profile turning on & off. But, I could not make any head & tail out of it. I'm new to REXX. Could you please take some time explaining me what is it. Perhaps, actual code would be very useful to me.

Thank you very much.
Navin. J
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group