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



TSO Programming, ISPF, SDF, SDSF and PDF, FTP, TCP/IP Concepts, SNA & SNA/IP etc...

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

Postby Steve Coalbran » Sun Jun 15, 2014 3:56 pm

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. :(
Steve
User avatar
Steve Coalbran
 
Posts: 138
Joined: Wed Apr 06, 2011 11:49 am
Location: Stockholm, Sweden
Has thanked: 13 times
Been thanked: 1 time

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

Postby Pedro » Tue Jun 17, 2014 12:03 am

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.
Pedro Vera
User avatar
Pedro
 
Posts: 686
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

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

Postby prino » Tue Jun 17, 2014 4:25 am

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:
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 641
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 29 times

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

Postby prino » Tue Jun 17, 2014 12:45 pm

Oops, missed the SCRNAME(...) on the cmd(isrepdf... )...
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 641
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 29 times

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

Postby Pedro » Tue Jun 17, 2014 8:52 pm

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?
Pedro Vera
User avatar
Pedro
 
Posts: 686
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

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

Postby Steve Coalbran » Tue Aug 26, 2014 11:58 am

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
Steve
User avatar
Steve Coalbran
 
Posts: 138
Joined: Wed Apr 06, 2011 11:49 am
Location: Stockholm, Sweden
Has thanked: 13 times
Been thanked: 1 time

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

Postby Steve Coalbran » Tue Aug 26, 2014 12:42 pm

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?
Steve
User avatar
Steve Coalbran
 
Posts: 138
Joined: Wed Apr 06, 2011 11:49 am
Location: Stockholm, Sweden
Has thanked: 13 times
Been thanked: 1 time

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

Postby prino » Wed Aug 27, 2014 12:28 pm

You've got the SCRNAME() on the wrong invocation. It should be on the
"SELECT CMD(ISREPDF" dsn bev") "
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 641
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 29 times

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

Postby Pedro » Wed Aug 27, 2014 6:59 pm

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.
Pedro Vera
User avatar
Pedro
 
Posts: 686
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times


Return to TSO & ISPF

 


  • Related topics
    Replies
    Views
    Last post