IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

passing values from ispf panel to REXX code


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rikdeb

New User


Joined: 19 Jan 2009
Posts: 63
Location: hyderabad

PostPosted: Sun Aug 17, 2014 4:36 pm
Reply with quote

I'm trying to design a ISPF panel and trying to pass values from the panel to rexx code. My rexx code is submitting one JCL for execution and separately is working fine. However I'm trying to pass the values from the panel and submit the same code. Its giving the error
"'SUBMIT' is not a recognized dialog service name."
For example I'm accepting DATE1 from the ISPF panel.
(Being very new to rexx,your valuable suggestions and input are most welcome!)
Panel code:
Code:

)ATTR                                           
# TYPE(TEXT) INTENS(LOW)  SKIP(ON)               
! TYPE(TEXT) INTENS(HIGH) SKIP(ON) COLOR(YELLOW)
)BODY                                           
%************************************************
% +ENTER SYSTEM NAME    ===>_SYSTEM  #           
% +ENTER DATEEM NAME    ===>_DAT1 #             
% +ENTER POLICY NUMB    ===>_POL1 #             
%                                               
%_MSG1                                           
%                                               
%                                               
%                                               
%************************************************
PF3=EXIT                                         
)INIT                                           
.CURSOR=SYSTEM                                   
)PROC                                           
&PFPRSD = .PFKEY                                 
)END                                             


Rexx code i am trying with
Code:
 /* REXX TESTREXX */                                           
ADDRESS TSO;                                                   
ADDRESS "ISPEXEC"                                             
"LIBDEF ISPPLIB DATASET ID('userid.REXX.PANEL')"               
START:                                                         
"DISPLAY PANEL(PANL1)"                                         
 IF PFPRSD = 'PF03' THEN                                       
     EXIT                                                     
USER =USERID()                                                 
SELECT                                                         
 WHEN SYSTEM = 'CASE1' THEN                                     
 DO                                                           
QUEUE "//"USER"A JOB (10,J15122),'UPDAT-',CLASS=T,"     
QUEUE "// MSGCLASS=V,NOTIFY=&SYSUID"                           
QUEUE "/*JOBPARM  L=0,T=0          "                           
QUEUE "//  SET DATE="DAT1"         "                           
QUEUE "//....."       
QUEUE "//SYSLIST   DD SYSOUT=*                       "         
QUEUE "$$"                                                     
O = OUTTRAP("OUTPUT.",,"CONCAT")                               
"SUBMIT * END($$)" /*SUBMIT JCL */                             
O = OUTTRAP(OFF)                                               
/* OUTPUT LINE SAYING SUBMIITED AND JOB ### */                 
SAY OUTPUT.2                                                   
SAY "YOUR OUTPUT DATASET WILL BE '"USER".BA."DAT1".DATASET2' " 
.........
 
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Aug 18, 2014 1:47 pm
Reply with quote

1) I suggest that you investigate and use ISPF file tailoring rather than inbuilt JCL

2) I also suggest that you read the TSO manual for the correct syntax of the submit command

3) You have constructed a queue of JCL statements. If you really do want to do it this way search the forum for INTRDR
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Mon Aug 18, 2014 7:04 pm
Reply with quote

icon_arrow.gif You certainly have noticed the way ISPF works with its panels.
As a general rule, a panel is displayed until you END(generally PF3) or RETURN(sometimes PF4).
There are two easy ways to achieve that "display until finished" loop:
Code:
Do Forever
  "DISPLAY PANEL(mypanel)"
  If RC > 0 Then Leave
  /* processing here */
End
Code:
"DISPLAY PANEL(mypanel)"
Do While RC = 0
   /* processing here */
   "DISPLAY PANEL(mypanel)"
End
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Mon Aug 18, 2014 7:05 pm
Reply with quote

icon_arrow.gif The first ADDRESS command is superfluous:
Code:
ADDRESS TSO;
ADDRESS "ISPEXEC"

The rules for the ADDRESS command are:
  1. If it is followed by a command, only this command is send to the specified environment.
    for example ADDRESS ISPEXEC "DISPLAY PANEL(mypanel)"
  2. If it has only an environment name, it becomes the new default environment.
    for example, after ADDRESS ISPEXEC, you can use "DISPLAY" but "EXECIO" will fail (you have to use ADDRESS TSO "EXECIO")
  3. If it has no parameter, it swaps back to its previous value.
    For example, when accessing DB2 you can have an ADDRESS DSNREXX, followed by all EXECSQL commands and then an ADDRESS to return to whatever environment was active before.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Mon Aug 18, 2014 7:08 pm
Reply with quote

icon_arrow.gif It is better (IMHO) not to have all the code in one big long spaghetti but instead to have little building blocks:
Code:
/* BUILDING BLOCK #1: DISPLAY AND DISPATCH */
Call Initial
Do Forever
  "DISPLAY PANEL(mypanel)"
  If RC > 0 Then Leave
  Select
     When SYSTEM = 'CASE1' Then Call Process_Case1
     When SYSTEM = 'CASE2' Then Call Process_Case2
  End
End
Call Terminal
Exit
Code:
/* BUILDING BLOCK #2: INITS AND PREPARATIONS */
Initial:
   /* init variables, connect to DB2 and so on...*/
Return
Code:
/* BUILDING BLOCK #3: BEFORE LEAVING */
Terminal:
   /* save variables, disconnect from DB2 and so on...*/
Return
Code:
/* BUILDING BLOCK #4: CASE1 */
Process_Case1:
   ...
Return
Code:
/* BUILDING BLOCK #5: CASE2 */
Process_Case2:
   ...
Return
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Mon Aug 18, 2014 9:21 pm
Reply with quote

Code:
"'SUBMIT' is not a recognized dialog service name."

Issue TSO PROFILE MSGID from the ISPF command line. When the error occurs, it will give you a message number and you can search the messages and codes book. It might be able to help you solve the problem.
Back to top
View user's profile Send private message
rikdeb

New User


Joined: 19 Jan 2009
Posts: 63
Location: hyderabad

PostPosted: Tue Aug 19, 2014 1:51 am
Reply with quote

Many Thanks to every one for taking out your time and coming up with your suggestions.
While playing out with the my code, i just tried adding address TSO before my submit command
Code:
ADDRESS TSO "SUBMIT * END($$)"

My code worked,but certainly not the best way. So i am trying to re built my code with ispf tailoring and following your suggestions!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
Search our Forums:

Back to Top