Panel REXX



IBM's Command List programming language & Restructured Extended Executor

Panel REXX

Postby pantierui » Mon Jun 27, 2011 8:46 am

I wrote panel using REXX.

The following is panell source named P@30610
)ATTR                                                                   
* TYPE(TEXT)   INTENS(HIGH) COLOR(BLUE)  CAPS(OFF)                     
# TYPE(TEXT)   INTENS(HIGH) COLOR(WHITE) CAPS(OFF)                     
@ TYPE(TEXT)   INTENS(LOW)  COLOR(GREEN)                               
_ TYPE(INPUT)  INTENS(HIGH) COLOR(WHITE) PAD('_') CAPS(OFF)             
{ TYPE(OUTPUT) INTENS(LOW)  COLOR(WHITE) CAPS(OFF)                     
)BODY                                                                   
*                          Database Archiving Tool                     
*                                                                       
*         @This utility will archive data in a database to GDGs         
*                                                                       
* Database/HLQ name:_DBname        *Date for Archiving:_ARVdate   #(dd/mm/yyyy)
*                                                                       
* Table Name 1:_TBLname1      +                                         
*                                                                       
* Table Name 2:_TBLname2      +             
                                       
 Table Name 3:_TBLname3      +         
                                       
 Table Name 4:_TBLname4      +         
                                       
 Table Name 5:_TBLname5      +         
                                       
 Table Name 6:_TBLname6      +         
                                       
                                       
 {INFO                                 
PROC                                   
ver(&DBname,nb)                         
ver(&ARVdate,nb)                       
ver(&ARVdate,pict,'nn/nn/nnnn')         
&KEYNUM = .PFKEY                       
vput(DBname ARVdate TBLname1 TBLname1 TBLname2 TBLname3 TBLname4 + 
     TBLname5 TBLname6) SHARED                                     
IF (&KEYNUM = 'PF03')                                               
   &NOMORE  = 'Y'                                                   
VGET(INFO)                                                         
END                                                                                           


REXX code
/* REXX                                                              */
/*********************************************************************/
/*                           MAIN ROUTINE                            */
/*********************************************************************/
ADDRESS TSO                                                             
KEYNUM = 0                                                             
NOMORE = ''                                                             
DO UNTIL (NOMORE = 'Y')                                                 
  CLRSCRN                                                               
  CALL DISPLAY_PANEL                                                   
END                                                                     
EXIT                                                                   
/*********************************************************************/
/* DISPLAY PANEL                                                     */
/*********************************************************************/
DISPLAY_PANEL:                                                         
                                                                       
  /* panel location */                                                 
  panel_pds = 'REXX.EXEC'                                             
  ADDRESS ISPEXEC "LIBDEF ISPPLIB DATASET ID("panel_pds") STACK"       
                                                                       
  /* clear panel's variable */                                         
  DBname   = ''                                                       
  ARVdate  = ''                                                       
  TBLname1 = ''                                                       
  TBLname2 = ''                                                       
  TBLname3 = ''                                                       
  TBLname4 = ''                                                       
 TBLname5 = ''                                   
 TBLname6 = ''                                   
                                                 
 /* put value into panel */                     
 ADDRESS ISPEXEC "VPUT (INFO) SHARED"           
                                                 
 /* display panel */                             
 ADDRESS ISPEXEC "CONTROL DISPLAY REFRESH"       
 ADDRESS ISPEXEC "DISPLAY PANEL(p@30610)"       
                                                 
 /* when you press F3 */                         
 IF KEYNUM = 'PF03'  THEN DO                     
    NOMORE = 'Y'                                 
    RETURN                                       
 END                                             
/* get value from panel */                                         
ADDRESS ISPEXEC "VGET (DBname ARVdate TBLname1 TBLname2 TBLname3 ,
                       TBLname4 TBLname5 TBLname6) SHARED"         
                                                                   
RETURN                                                             


when I input DB2T into panel's Database/HLQ name field. the srcreen goto the following screen.
DB2I PRIMARY OPTION MENU SSID: DB2T
COMMAND ===>

Select one of the following DB2 functions and press ENTER.

1 SPUFI (Process SQL statements)
2 DCLGEN (Generate SQL and source language declarations)
3 PROGRAM PREPARATION (Prepare a DB2 application program to run)
4 PRECOMPILE (Invoke DB2 precompiler)
5 BIND/REBIND/FREE (BIND, REBIND, or FREE plans or packages)
6 RUN (RUN an SQL program)
7 DB2 COMMANDS (Issue DB2 commands)
8 UTILITIES (Invoke DB2 utilities)
D DB2I DEFAULTS (Set global parameters)
X EXIT (Leave DB2I)

note: DB2T is db2 ssid.

I don't find way to sovle this issuse.
Please give me some suggestion.
thank you for your help.
pantierui
 
Posts: 6
Joined: Mon Jun 13, 2011 8:37 am
Has thanked: 0 time
Been thanked: 0 time

Re: Panel REXX

Postby NicC » Mon Jun 27, 2011 10:57 am

1) it is NOT a Rexx panel - it is an ISPF panel
2) you do not CLRSCRN - the DISPLAY service clears the screen for you
3) you do not nee to fiddle about checking for PF3 being pressed - just check the retrun code from DISPLAY - check the maual or MODEL command for the various return codes and their meanings.

I do not know if this is the cause of your problem but you do not have a command field so ISPF may be using your first input field as the command field and DB2T may be a command.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Panel REXX

Postby pantierui » Mon Jun 27, 2011 11:45 am

Nic,Thank you for your help

As you said, I have not command field, so ISPF using my first input field as command field.

but I do not need command field. is there any way?

Thanks.
pantierui
 
Posts: 6
Joined: Mon Jun 13, 2011 8:37 am
Has thanked: 0 time
Been thanked: 0 time

Re: Panel REXX

Postby enrico-sorichetti » Mon Jun 27, 2011 12:09 pm

but I do not need command field. is there any way?

any reason not to look at the manuals Yourself to find out how to do it ? :evil:
starting from here
http://publibz.boulder.ibm.com/cgi-bin/ ... s/ISPZPM70
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Panel REXX

Postby pantierui » Mon Jun 27, 2011 12:30 pm

Nic
Thank you for your help.
pantierui
 
Posts: 6
Joined: Mon Jun 13, 2011 8:37 am
Has thanked: 0 time
Been thanked: 0 time

Re: Panel REXX

Postby pantierui » Mon Jun 27, 2011 1:00 pm

Thank you for your help, Enrico

I find the way.

In panel source, I add cmd() to )body section.

thank you again.
pantierui
 
Posts: 6
Joined: Mon Jun 13, 2011 8:37 am
Has thanked: 0 time
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post