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?