Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

TSO/REXX script to open multiple screens dynamically

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
Scott Latunski

New User


Joined: 04 Mar 2013
Posts: 3
Location: United States

PostPosted: Fri Apr 19, 2013 9:38 am    Post subject: TSO/REXX script to open multiple screens dynamically
Reply with quote

I've seen multiple queries in general about these sorts or scripts, but none with the problem I am having currently...

I am trying to read in a PDS member that has a list of data sets that will be opened by the REXX script (eg if I type in "TSO STARTUP C05OOBS" it will open the screens necessary to trouble shoot C05 out of balances).

I have nearly accomplished this but I am running into one major problem. New screens are being opened up without the tight datasets, but the new screens will simply be stacked on eachother on top of the screen that I started the script on and will not start on a new screen.

The third chunk of code is the most important, but I expanded the Hierarchical logic for those who wish to see more context. Thank you for your time and help in solving this issue!

Code:

01420_OPEN_HLQS:                   
 DO A = 1 TO PDSMEMB.0             
   CALL 01425_PARSE_VARIABLES     
   CALL 01427_SELECT_AND_OPEN     
 END                               
01420_EXIT:                       
RETURN                             


Code:

01425_PARSE_VARIABLES:                       
   TYPE = ''                                 
   SUBTYPE = ''                             
   ELEMENT = ''                             
   SCRNAME = ''                             
 IF SUBSTR(PDSMEMB.A,1,1) \=  '*' THEN DO   
                                             
   LINE = PDSMEMB.A                         
   PARSE UPPER VAR LINE TYPE  ELEMENT SCRNAME
   TYPE    = STRIP(TYPE)                     
   ELEMENT = STRIP(ELEMENT)                 
   SCRNAME = STRIP(SCRNAME)                 
                                             
   IF SUBSTR(TYPE,1,2) =  'DS' THEN DO       
   /*NEED LOGIC TO KNOW IF IT IS A GDG*/     
   END                                       
 END                                         
01425_EXIT:                                 
RETURN                                       


Code:

01427_SELECT_AND_OPEN:                                     
    SELECT                                                 
      WHEN (TYPE =  'HLQ') THEN DO                         
       ADDRESS ISPEXEC;                                   
     [b]"SELECT PGM(ISPSTRT) PARM(SCRNAME ON;                 
           SCRNAME "SCRNAME" PERM; SWAP) "  [/b]               
     /*IF RC=0 THEN DO */                                 
          "LMDINIT LISTID(HLQDATA) LEVEL("ELEMENT")"       
          "LMDDISP LISTID("HLQDATA")"                     
          "LMDFREE LISTID("HLQDATA")"                     
     /*END                                                 
       ELSE DO                                             
         SAY "OPEN FAILED. PLEASE TRY AGAIN"; EXIT         
       END*/                                               
       ADDRESS TSO;                                       
      END                                                 


I only put the first part of the SELECT statement here because that is the only part of the logic that I am currently working with.
Back to top
View user's profile Send private message

Stefan

Active User


Joined: 12 Jan 2006
Posts: 110
Location: Germany

PostPosted: Fri Apr 19, 2013 12:10 pm    Post subject:
Reply with quote

If I understand you correctly you open (view/edit) the data set just after your invocation of ISPSTRT program in section 01427_SELECT_AND_OPEN.
I think you should instead create a separate command which performs the open actions. Then pass this command together with the SCRNAME command and a SWAP command to the ISPSTRT program as in this example:
Code:
                                  /* Start a new screen, invoke */     
                                  /* the cmd, name the screen   */     
                                  /* and swap back afterwards.  */     
"ispexec select pgm(ispstrt) parm(tso ex 'mycmd';scrname" n.j";swap 1)"

You can see my working solution at my web site.
Hope this helps
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 990
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Fri Apr 19, 2013 1:07 pm    Post subject:
Reply with quote

... and this is in the JCL Forum because.... ???
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Apr 19, 2013 1:34 pm    Post subject:
Reply with quote

Because I forgot to move it icon_redface.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Apr 19, 2013 2:54 pm    Post subject: Reply to: TSO/REXX script to open multiple screens dynamical
Reply with quote

I see that the COBOL plague of numbering functions and subroutines has contaminated the once healthy REXX world icon_cool.gif

what is the reason to <start> a new screen and not to proceed sequentially ?

You might find that after You have started the maximum number of screens defined for Your installation things get pretty murky,

anyway the navigation is quite unfriendly,
the swap sequence is hard to follow,
and panels, if the user does not pay enough attention are left hanging around.

just checked with a simple snippet .
Back to top
View user's profile Send private message
Grant Goodale

New User


Joined: 13 Nov 2010
Posts: 55
Location: Brampton, Ontario, Canada

PostPosted: Fri Apr 19, 2013 7:49 pm    Post subject: Reply to: TSO/REXX script to open multiple screens dynamical
Reply with quote

Enrico -

Navigation can be made a little easier if you are running with SWAPBAR ON. As long as you have a meaningful screen name, it can be as close to point and shoot as a 3270 can get.

Still is an ugly requirement.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Apr 19, 2013 7:52 pm    Post subject: Reply to: TSO/REXX script to open multiple screens dynamical
Reply with quote

Yep...
but things get really sh**ty when You start more screens than allowed
Back to top
View user's profile Send private message
Scott Latunski

New User


Joined: 04 Mar 2013
Posts: 3
Location: United States

PostPosted: Sat Apr 20, 2013 2:00 am    Post subject: Reply to: TSO/REXX script to open multiple screens dynamical
Reply with quote

Thank you all for your helpful input.

Enrico - this will be mainly used as a startup script that will accept a parameter "group name" to open up the respective screens that you would like to open. However, it will also be A TSO command that can be activated at anytime. I was hoping to develop some routine that can calculate how many screens that are currently open (any pointers???) to see if the routine called would open too many screens. I'm guessing a return code higher than zero (this is an assumption, haven't tried it yet) from the ISPEXEC SELECT PGM(ISPSTRT) command might be the route to determine if no more screens can be opened. am not to that point yet though and I am trying to just get the startup script working. Also, the paragraph labels with the numbers is extremely useful when debugging. TRACE(LABELS) will output all the labels and I like to see the logical flow and the numbers give me a good idea when in my program the logic is happening.

Stefan - You were correct in assuming that I am opening up the dataset just after the ISPSTRT command. THE LMD commands are the only way I know to open up HLQs "groupings". Great idea with executing the TSO command from the ISPSTRT parm. I'll give that a shot and let you know what happens.
Back to top
View user's profile Send private message
Grant Goodale

New User


Joined: 13 Nov 2010
Posts: 55
Location: Brampton, Ontario, Canada

PostPosted: Sat Apr 20, 2013 2:13 am    Post subject:
Reply with quote

Scott -

The ISPF dialog variable ZSCRCUR gives the number of screens currently open and ZSCRMAX gives the maximum allowed in your installation.

HTH
Back to top
View user's profile Send private message
Scott Latunski

New User


Joined: 04 Mar 2013
Posts: 3
Location: United States

PostPosted: Sat Apr 20, 2013 8:54 pm    Post subject: Reply to: TSO/REXX script to open multiple screens dynamical
Reply with quote

Putting the TSO command in the ISPSTART parm worked. Thanks everyone!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us