MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Error in VGET

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
sricons123
Beginner


Joined: 04 Oct 2004
Posts: 21
Topics: 11

PostPosted: Thu Jun 07, 2012 6:55 am    Post subject: Error in VGET Reply with quote

Hi

I'm trying to display the programs thru TBDISPL. After that if the user selects any program from the list, I'm displaying the selected program. To get the user response, I used VGET command, but I'm getting RC 20 after VGET.
This is my code:

REXX:
Code:

/* REXX */
ADDRESS ISPEXEC
   'CONTROL ERRORS RETURN'
'LIBDEF ISPPLIB DATASET ID('"'"OZA.TEST.SOURCE"')"
'LIBDEF ISPMLIB DATASET ID('"'"OZA.TEST.SOURCE"')"
ADDRESS ISPEXEC "CONTROL DISPLAY REFRESH"
"TBCREATE MYLIST NAMES(P1,P2,P3,P4) NOWRITE REPLACE"

  P1 = 'ABC100'
  P2 = 'ABC101'
  P3 = 'ABC102'
  P4 = 'ABC103'
    "TBADD MYLIST"

  P1 = 'ABC104'
  P2 = 'ABC105'
  P3 = 'ABC106'
  P4 = 'ABC107'
    "TBADD MYLIST"

"TBTOP MYLIST"

 'ADDPOP ROW(3) COLUMN(6)'
   DO UNTIL PFKEY  = 'PF3'
    ADDRESS ISPEXEC "CONTROL DISPLAY REFRESH"
    "TBDISPL MYLIST PANEL(LIST1) POSITION(CURROW)"
     'VGET (I1 I2 I3 I4) PROFILE'
     SAY 'I1=' I1 I2 I3 I4
    SAY RC
   IF RC = 8 THEN
     DO
     SAY 'PF3 PRESSED'
     'REMPOP'
     EXIT
     END
   ELSE DO
          SAY 'ZCMD =' ZCMD
              SAY 'CURROW =' CURROW
/* REXX */
ADDRESS ISPEXEC
   'CONTROL ERRORS RETURN'
'LIBDEF ISPPLIB DATASET ID('"'"OZA.TEST.SOURCE"')"
'LIBDEF ISPMLIB DATASET ID('"'"OZA.TEST.SOURCE"')"
ADDRESS ISPEXEC "CONTROL DISPLAY REFRESH"
"TBCREATE MYLIST NAMES(P1,P2,P3,P4) NOWRITE REPLACE"

  P1 = 'ABC100'
  P2 = 'ABC101'
  P3 = 'ABC102'
  P4 = 'ABC103'
    "TBADD MYLIST"

  P1 = 'ABC104'
  P2 = 'ABC105'
  P3 = 'ABC106'
  P4 = 'ABC107'
    "TBADD MYLIST"

"TBTOP MYLIST"

 'ADDPOP ROW(3) COLUMN(6)'
   DO UNTIL PFKEY  = 'PF3'
    ADDRESS ISPEXEC "CONTROL DISPLAY REFRESH"
    "TBDISPL MYLIST PANEL(LIST1) POSITION(CURROW)"
     'VGET (I1 I2 I3 I4) PROFILE'
     SAY 'I1=' I1 I2 I3 I4
    SAY RC
   IF RC = 8 THEN
     DO
     SAY 'PF3 PRESSED'
     'REMPOP'
     EXIT
     END
   ELSE DO
          SAY 'ZCMD =' ZCMD
              SAY 'CURROW =' CURROW
---------------------
Panel:

)PANEL
)ATTR DEFAULT(%+_)
  _ TYPE(INPUT) INTENS(HIGH)  JUST(ASIS)
  } TYPE(INPUT) INTENS(HIGH)  JUST(ASIS)
  ! TYPE(OUTPUT) INTENS(HIGH) PAD('') JUST(ASIS) COLOR(TURQ)
)BODY EXPAND(//) WINDOW (60,40)
%COMMAND ==>_ZCMD
#
+     PROGRAM
+     --------
)MODEL CLEAR(I1,I2,I3,I4)
   _I1+!P1      _I2+!P2      _I3+!P3      _I4+!P4
)INIT
   &ZCMD = ''
    &ZTDMARK=' '

)REINIT
     &ZTDMARK=' '
      REFRESH (I1,I2,I3,I4)

)PROC
       &COMMAND = ' '
       VER(&A1,PICT,'A')
      &PFKEY = .PFKEY
      VGET (I1 I2 I3 I4)
)END

And also

1. How to restrict the input to one char. Now I'm getting two
2.How to find cursor column position?
Back to top
View user's profile Send private message AIM Address
sricons123
Beginner


Joined: 04 Oct 2004
Posts: 21
Topics: 11

PostPosted: Thu Jun 07, 2012 7:19 am    Post subject: Reply with quote

Above rexx is incomplete. Pls consider the below..
Code:

/* REXX */
ADDRESS ISPEXEC
   'CONTROL ERRORS RETURN'
'LIBDEF ISPPLIB DATASET ID('"'"A.B.C.D"')"
'LIBDEF ISPMLIB DATASET ID('"'"A.B.C.D"')"
ADDRESS ISPEXEC "CONTROL DISPLAY REFRESH"
"TBCREATE MYLIST NAMES(P1,P2,P3,P4) NOWRITE REPLACE"

  P1 = 'ABC100'
  P2 = 'ABC101'
  P3 = 'ABC102'
  P4 = 'ABC103'
    "TBADD MYLIST"

  P1 = 'ABC104'
  P2 = 'ABC105'
  P3 = 'ABC106'
  P4 = 'ABC107'
    "TBADD MYLIST"

"TBTOP MYLIST"

 'ADDPOP ROW(3) COLUMN(6)'
   DO UNTIL PFKEY  = 'PF3'
    ADDRESS ISPEXEC "CONTROL DISPLAY REFRESH"
    "TBDISPL MYLIST PANEL(LIST1) POSITION(CURROW)"
     'VGET (I1 I2 I3 I4) PROFILE'
     SAY 'I1=' I1 I2 I3 I4
    SAY RC
   IF RC = 8 THEN
     DO
     SAY 'PF3 PRESSED'
     'REMPOP'
     EXIT
     END
   ELSE DO
          SAY 'ZCMD =' ZCMD
              SAY 'CURROW =' CURROW
           IF CURROW > 0 THEN
              DO
                "TBTOP MYLIST"
                CRP = CURROW -1
                "TBSKIP(CRP) MYLIST"
                SAY P1 P2 P3 P4
                IF I1 = 'S' THEN
                    SAY 'SELECTED PROGRAM= ' P1
                IF I2 = 'S' THEN
                    SAY 'SELECTED PROGRAM= ' P2
                IF I3 = 'S' THEN
                    SAY 'SELECTED PROGRAM= ' P3
                IF I4 = 'S' THEN
                    SAY 'SELECTED PROGRAM= ' P4
               END
         END

   END
Back to top
View user's profile Send private message AIM Address
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Thu Jun 07, 2012 9:43 am    Post subject: Reply with quote

no one wants to wade thru you code.

1. use TRACE ?R to follow you code.

2. I would get out of the habit assuming RC is unchanged
Code:
'VGET (I1 I2 I3 I4) PROFILE'
SAY 'I1=' I1 I2 I3 I4
SAY RC
IF RC = 8 THEN

and code something like this:
Code:
'VGET (I1 I2 I3 I4) PROFILE'
VGET_RC = RC
SAY 'I1=' I1 I2 I3 I4
SAY VGET_RC
IF VGET_RC = 8 THEN

_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
asr2
Beginner


Joined: 25 Jun 2011
Posts: 26
Topics: 4
Location: Germany

PostPosted: Sat Jun 30, 2012 11:55 pm    Post subject: Reply with quote

The length of an input field is determined by the size of the field in the panel definition. So, rather than I1, I2,... J, K,... or alternatively use .ZVARS to define, in effect, aliases for variable names - in this case, the Z pseudo variable is used in the panel definition.
RC 20 indicates a severe error; the ZERRLM system variable provides information about the error.
VGET is not normally required after a TBDISPL, in particular why VGET PROFILE?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group