IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

TSO/REXX script to open multiple screens dynamically


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
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
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
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

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Fri Apr 19, 2013 1:07 pm
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: 8797
Location: Welsh Wales

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

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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Apr 19, 2013 2:54 pm
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: 67
Location: Brampton, Ontario, Canada

PostPosted: Fri Apr 19, 2013 7:49 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Apr 19, 2013 7:52 pm
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
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: 67
Location: Brampton, Ontario, Canada

PostPosted: Sat Apr 20, 2013 2:13 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
Search our Forums:

Back to Top