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 

Alternative swap Command:

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
Troodon
Beginner


Joined: 10 Sep 2004
Posts: 9
Topics: 4
Location: Johannesburg, Gauteng, South Africa

PostPosted: Fri Sep 10, 2004 4:08 pm    Post subject: Alternative swap Command: Reply with quote

I am trying to create an alternative swap command for ISPF. I have a problem getting the start and swap commands working in Rexx, does anyone know whats wrong? Follows is the rexx with various options I have tried commented out (near the bottom of the REXX).
Code:

/* REXX */
/* ================================================================== */
/* Language   : REXX
 * Name       : aswap
 * Category   : ISPF command Alternative swap command
 * Description: ISPF command to switch to the screen asked for.
 *              IF already on that screen go nowhere.
 *              IF the screen does not exist, then start a new screen
 *              until the screen number requested has been created.
 *              IF the screen does exist, then swap to it.
 * Rexx       : none
 * Panels     : none
 * Skeltons   : none
 * Messages   : none
 * Procedure  : none
 * Author     : Alan Wynne.
 * Owner      : Alan Wynne.
 * Created    : September 2004
 * Modified   :                                                       */
/* ================================================================== */
/*TRACE ?R */

/* ------------------------------------------------------------------ */
/* Get the argument passed to the procedure.                          */

  parse arg screen

/* ------------------------------------------------------------------ */
/* Default the value of the argument to 1 if nothing was passed.      */

  if screen = ''  then screen = 1

/* ------------------------------------------------------------------ */
/* Determine some of the ISPF Varialbles.                             */

  "ispexec vget     (zscrmax )   "
  "ispexec vget     (zscrcur )   "
  "ispexec vget     (zscreen )   "

/* ------------------------------------------------------------------ */
/* For debuging purposes, diplay the results.                         */

  say 'zscrmax     = ' zscrmax
  say 'zscreen     = ' zscreen
  say 'Screen      = ' screen

/* ------------------------------------------------------------------ */
/* if the screen number requested is greater than the max number of   */
/* screens allowed then return with an error message and do nothing.  */

  if screen > zscrmax then
    do
      retmessage = 'Max '||ZSCRMAX||' screens allowed'
      zedsmsg = retmessage
      zedlmsg = retmessage
      "ispexec setmsg msg(isrz000) "
      return
    end

/* ------------------------------------------------------------------ */
/* if the screen number requested is equal to the current screen      */
/* number then set the error message to say what screen you are on    */
/* and return.                                                        */

  if screen = zscreen then
    do
      retmessage = 'Screen: ' || screen
      zedsmsg = retmessage
      zedlmsg = retmessage
      "ispexec setmsg msg(isrz000) "
      return
    end

/* ------------------------------------------------------------------ */
/* if the screen number requested is greater than the number of       */
/* screens availble then start new screens until the screen number    */
/* requested is reached and return.                                   */

/*TRACE ?R */

  if screen > zscrcur then
    do i = zscrcur To screen
[size=18][b]      "ispexec start "
/*    "TSO     start " */
/*    "MVS     start " */
/*    start            */
/*    "start         " */[/b] [/size]   end

/* ------------------------------------------------------------------ */
/* Update the zscrcur and zscreen system varialbels.                  */
/* if the current screen number is not equal to the desired screen    */
/* number then swap to the desired screen number.                     */

  "ispexec vget     (zscrcur )   "
  "ispexec vget     (zscreen )   "
[size=18][b]  if zscreen ^= screen then "ispexec swap       " screen
/*if zscreen ^= screen then "tso     swap       " screen */
/*if zscreen ^= screen then "MVS     swap       " screen */
/*if zscreen ^= screen then swap screen                  */
/*if zscreen ^= screen then "        swap       " screen */[/b][/size]
/* ------------------------------------------------------------------ */
/* Update the zscreen system varialbels.                              */
/* set the error message to display the current screen number and     */
/* the return                                                         */

  "ispexec vget     (zscreen )   "
  retmessage = 'Screen: ' || zscreen
  zedsmsg = retmessage
  zedlmsg = retmessage
  "ispexec setmsg msg(isrz000)   "

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


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

PostPosted: Sat Sep 11, 2004 4:40 pm    Post subject: Reply with quote

you are confusing command table entries with ispf programmable commands. ISPF command entries like START, SWAP, END, etc . may or may not have a direct corresponding ISPEXEC command. You can look at the command table (ISP in option 3.9) to see if they do. SWAP does not. You may be able to do some things with the DISPLAY CMD(...) command and a dummy panel, but if SWAP is involved, you may not be able to do much because each screen is its own task (TCB) and your exec will only run in the originating task. Once the other screen receives control, your exec is no longer running.

On the other hand, if all you want to do is swap to a known numbered screen, you can define a PFKEY to SWAP (PF9 is already set that way by default) and simply place the screen number in any command line and press that key. Or use SWAP LIST and select the screen. Or you can name the screens ( see SCRNAME) and use a name instead of a number. Search Google groups. You'll probably find quite a bit of discussion there.
Back to top
View user's profile Send private message Visit poster's website
Troodon
Beginner


Joined: 10 Sep 2004
Posts: 9
Topics: 4
Location: Johannesburg, Gauteng, South Africa

PostPosted: Mon Sep 13, 2004 12:57 am    Post subject: Reply with quote

I have setup my Keyboard so that ctrl+1 and ctrl+2 etc type the swap command with the relative number on the command line and press enter. The problem is that if screen 4 has not yet been started, and I swap to screen 4, the screen swaps but to a different location. I wish the swap command to change to screen 4 and if screen four has not yet been started it must start screens untill screen four has been created, and then swap to screen four. Can this not be done in REXX?
Back to top
View user's profile Send private message
arnold57
Beginner


Joined: 01 Oct 2004
Posts: 30
Topics: 0

PostPosted: Fri Oct 01, 2004 4:58 pm    Post subject: Reply with quote

You can start new screens from a REXX exec using:

address ispexec "SELECT PGM(ISPSTRT) PARM(SWAP)"
address ispexec "SELECT PGM(ISPSTRT) PARM(SWAP)"
etc.

You must end each parm field with SWAP to swap back to your current screen
or your exec will lose control to the screen you just created.
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
Page 1 of 1

 
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