Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

passing values from ispf panel to REXX code

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
rikdeb

New User


Joined: 19 Jan 2009
Posts: 59
Location: hyderabad

PostPosted: Sun Aug 17, 2014 4:36 pm    Post subject: passing values from ispf panel to REXX code
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: 8593
Location: Back in jolly old England

PostPosted: Mon Aug 18, 2014 1:47 pm    Post subject:
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: 1218
Location: Israel

PostPosted: Mon Aug 18, 2014 7:04 pm    Post subject:
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: 1218
Location: Israel

PostPosted: Mon Aug 18, 2014 7:05 pm    Post subject:
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: 1218
Location: Israel

PostPosted: Mon Aug 18, 2014 7:08 pm    Post subject:
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

Senior Member


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

PostPosted: Mon Aug 18, 2014 9:21 pm    Post subject: Reply to: passing values from ispf panel to REXX code
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: 59
Location: hyderabad

PostPosted: Tue Aug 19, 2014 1:51 am    Post subject: Reply to: passing values from ispf panel to REXX code
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    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am
No new posts IDEAL - Code Retrieval yugendran CA Products 0 Fri Nov 25, 2016 3:27 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts Overlaying one set of charater values... Kevin Lindsley SYNCSORT 7 Sat Nov 05, 2016 3:21 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us