Page 1 of 1

START a command to VIEW 'ds' in new screen, & close after

PostPosted: Sun Jun 15, 2014 3:56 pm
by Steve Coalbran
I want to START a command/program to VIEW a dataset in a new screen and return closing the new screen on EXIT, without seeing the POM.
So, I guessed it would be something like...
"SELECT PGM(ISPSTRT) PARM("MYVIEW") "
where rexx exec MYVIEW would be (something like but that works!)
ADDRESS ISPEXEC "VIEW DATASET("ds") SCRNAME(MYVIEW) "
QUEUE "RETURN"
EXIT
The dataset in VIEW should hence display MYVIEW in the SWAPBAR.
RETURNing from the dataset VIEW should remove the scrname of MYVIEW from the SWAPBAR.

Perhaps there is a parameter on ISPSTRT that support this?
I have been searching but found nothing. :(

Re: START a command to VIEW 'ds' in new screen, & close afte

PostPosted: Tue Jun 17, 2014 12:03 am
by Pedro
I was able to get this to work for me:

Issue TSO %MYSTRT from any ISPF primary command line.
1. mystrt:
/* rexx */                                               
Address ISPEXEC "SELECT PGM(ISPSTRT) PARM(CMD(%view3A)) "


2. view3a:
/* rexx */                                           
Address ISPEXEC "SELECT CMD(%view3) SCRNAME(MYVIEW)" 


3. view3:
/* rexx */                                 
Address ISPEXEC "VIEW DATASET(temp.cntl)"   


It opens a new split screen that shows my data set in panel ISREDDE2, with the screen name being 'MYVIEW'.

I needed three parts to do it. If you add the SCRNAME parameter in the SELECT statement of the first part, the screen name will be on the wrong side of the split screen. It is a parameter to the SELECT statement, not to the ISPSTRT program.

When I pressed F3, I did -not- see the primary option menu. In your example, you put 'RETURN' into the TSO stack. It will likely not get executed until you exit ISPF. ISPF does not pull from the TSO stack.

Re: START a command to VIEW 'ds' in new screen, & close afte

PostPosted: Tue Jun 17, 2014 4:25 am
by prino
The following will work:

/* REXX */
parse arg dsn

parse source . . moi .

if left(dsn, 1) = x2c(00) then
  do
    dsn = substr(dsn, 2)
    "ispexec select cmd(isrepdf" dsn "view)"

    zcmd = ";return"
    "ispexec control nondispl end"
    "ispexec display panel(isr@prim)"
  end
else
  "ispexec select pgm(ispstrt) parm(tso" moi x2c(00)dsn")"
exit


Enjoy :mrgreen:

Re: START a command to VIEW 'ds' in new screen, & close afte

PostPosted: Tue Jun 17, 2014 12:45 pm
by prino
Oops, missed the SCRNAME(...) on the cmd(isrepdf... )...

Re: START a command to VIEW 'ds' in new screen, & close afte

PostPosted: Tue Jun 17, 2014 8:52 pm
by Pedro
I am not sure I understand this part:
zcmd = ";return"
    "ispexec control nondispl end"
    "ispexec display panel(isr@prim)"

Because ISR@PRIM has &ZPRIM=YES, I think the RETURN command will only apply to it, making the combination of DISPLAY with RETURN a NOP. Or is this a nuance of using DISPLAY vs. SELECT?

As I said earlier, I do not see the primary option menu when I end the VIEW session. Do you see a primary option menu?

Re: START a command to VIEW 'ds' in new screen, & close afte

PostPosted: Tue Aug 26, 2014 11:58 am
by Steve Coalbran
Re: The following will work: Post by prino ยป Mon Jun 16, 2014 11:55 pm

The following will work:
Hi Robert,
I tried a modification of your code (which incidentally works fine before my alterations!).
I tried to pass an Browse/Edit/View option in. Works fine for Browse & View but doesn't like Edit. ISREPDF has no Edit option and it does not appear to be thee default. :(
/* REXX */ TRACE "I"                                           
PARSE ARG dsn bev                                               
SELECT                                                         
WHEN( ABBREV("BROWSE",bev,1) )THEN bev="BROWSE"                 
WHEN( ABBREV("EDIT",bev,1)   )THEN bev="EDIT"                   
OTHERWISE                          bev="VIEW"                   
END/*SELECT*/                                                   
PARSE SOURCE . . moi .                                         
IF LEFT(dsn, 1) = X2C(00) THEN DO                               
   dsn = SUBSTR(dsn, 2)                                         
   "ISPEXEC SELECT CMD(ISREPDF" dsn bev")"                     
   zcmd = ";RETURN"                                             
   "ISPEXEC CONTROL NONDISPL END"                               
   "ISPEXEC DISPLAY PANEL(ISR@PRIM)"                           
   END                                                         
ELSE                                                           
   "ISPEXEC SELECT PGM(ISPSTRT) PARM(TSO" moi X2C(00)dsn bev")"
EXIT

With the Edit option I get...
ISREPDF parameter error
                       
The syntax is         
ISREPDF dataset-name < options>                     
        <Browse            >                       
        <Recover           >                       
        <Macro   macro-name>                       
        <Profile profile   >                       
        <PAnel   panel-name>                       
        <Format  form      >                       
        <MIxed   Yes|No    >                       
        <View              >                       
        <PREserve          >                       
        <Confirm Yes|No    >                       
                                                   
(Type ISREPDF ? for more details)                   
                                                   
The following parameters are not recognized: "EDIT"
***

But I think I got around this by devious means, It does work BUT I'm afraid I'm missing something simpler...
/* REXX */ TRACE "O"                                           
PARSE ARG dsn bev                                             
dnm = TRANSLATE(dsn,"  ","()")                                 
typ = WORD(SUBSTR(dnm,LASTPOS(".",dnm)+1),1)                   
SELECT                                                         
WHEN( ABBREV("BROWSE",bev,1) )THEN bev="BROWSE"               
WHEN( ABBREV("EDIT",bev,1)   )THEN bev="PROTYP"               
WHEN( bev="PROTYP"           )THEN bev="PROFILE" typ           
OTHERWISE                          bev="VIEW"                 
END/*SELECT*/                                                 
PARSE SOURCE . . moi .                                         
IF LEFT(dsn, 1) = X2C(00) THEN DO                             
   dsn = SUBSTR(dsn, 2)                                       
   "ISPEXEC SELECT CMD(ISREPDF" dsn bev")"                     
   zcmd = ";RETURN"                                           
   "ISPEXEC CONTROL NONDISPL END"                             
   "ISPEXEC DISPLAY PANEL(ISR@PRIM)"                           
   END                                                         
ELSE                                                           
   "ISPEXEC SELECT PGM(ISPSTRT) PARM(TSO" moi X2C(00)dsn bev")"
EXIT     

Is there a better/simpler way than this - Any ideas? :D

Re: START a command to VIEW 'ds' in new screen, & close afte

PostPosted: Tue Aug 26, 2014 12:42 pm
by Steve Coalbran
Moving swiftly on I realize I'd forgotten the original SCRNAME bit!
/* REXX */ TRACE "C"                                 
ARG parms                                           
PARSE VALUE parms",,,," WITH dsn","scr","bev"," .   
ADDRESS ISPEXEC                                     
dnm = TRANSLATE(dsn,"  ","()")                       
typ = WORD(SUBSTR(dnm,LASTPOS(".",dnm)+1),1)         
IF( scr="" )THEN DO                                 
   SELECT                                           
   WHEN( ABBREV("BROWSE",bev,1) ,                   
       | ABBREV("EDIT",bev,1) )THEN scr=bev         
   WHEN( bev="PROTYP"         )THEN scr="EDIT"       
   OTHERWISE                        scr="VIEW"       
   END/*SELECT*/                                     
   END                                               
ELSE NOP                                             
SELECT                                               
WHEN( ABBREV("BROWSE",bev,1) )THEN bev="BROWSE"     
WHEN( ABBREV("EDIT",bev,1)   )THEN bev="PROTYP"     
WHEN( bev="PROTYP"           )THEN bev="PROFILE" typ
OTHERWISE                          bev="VIEW"       
END/*SELECT*/                                       
PARSE SOURCE . . moi .                               
IF LEFT(dsn, 1) = X2C(00) THEN DO                   
   dsn = SUBSTR(dsn, 2)                             
   "SELECT CMD(ISREPDF" dsn bev") "                 
   zcmd = ";RETURN "                                 
   "CONTROL NONDISPL END "                           
   "DISPLAY PANEL(ISR@PRIM) "                       
   END                                               
ELSE                                                 
   "SELECT PGM(ISPSTRT)",                           
           "PARM(TSO" moi X2C(00)dsn','scr','bev")",
           "SCRNAME("scr") "                         
EXIT 

Saving to a new exec USER.EXEC(BEVSN) and executing as: Command ===> TSO BEVSN USER.EXEC(#),BANANA,E
I get into EDIT on the required member but the SCRNAME is on the wrong screen! :(

SWAPBAR Before:
*EDIT
SWAPBAR After:
-BANANA *ISREDDE

:? (again) Ideas?

Re: START a command to VIEW 'ds' in new screen, & close afte

PostPosted: Wed Aug 27, 2014 12:28 pm
by prino
You've got the SCRNAME() on the wrong invocation. It should be on the
"SELECT CMD(ISREPDF" dsn bev") "

Re: START a command to VIEW 'ds' in new screen, & close afte

PostPosted: Wed Aug 27, 2014 6:59 pm
by Pedro
Is there a better/simpler way than this

I thought my examples posted here on Mon Jun 16, 2014 11:33 am were pretty simple.