View previous topic :: View next topic
|
Author |
Message |
Scott Latunski
New User
Joined: 04 Mar 2013 Posts: 3 Location: United States
|
|
|
|
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 |
|
|
Stefan
Active User
Joined: 12 Jan 2006 Posts: 110 Location: Germany
|
|
|
|
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 |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
... and this is in the JCL Forum because.... ??? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Because I forgot to move it |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
I see that the COBOL plague of numbering functions and subroutines has contaminated the once healthy REXX world
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 |
|
|
Grant Goodale
New User
Joined: 13 Nov 2010 Posts: 67 Location: Brampton, Ontario, Canada
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Yep...
but things get really sh**ty when You start more screens than allowed |
|
Back to top |
|
|
Scott Latunski
New User
Joined: 04 Mar 2013 Posts: 3 Location: United States
|
|
|
|
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 |
|
|
Grant Goodale
New User
Joined: 13 Nov 2010 Posts: 67 Location: Brampton, Ontario, Canada
|
|
|
|
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 |
|
|
Scott Latunski
New User
Joined: 04 Mar 2013 Posts: 3 Location: United States
|
|
|
|
Putting the TSO command in the ISPSTART parm worked. Thanks everyone! |
|
Back to top |
|
|
|