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
 

 

How to define a ZVAR to accept sentence/word in Panel

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 188
Location: india

PostPosted: Wed Jul 06, 2011 6:22 pm    Post subject: How to define a ZVAR to accept sentence/word in Panel
Reply with quote

Hello,

I am facing issues with below panel where i want ZVARS defined for Narrative i.e. NAR, NAR1 and NAR2 to accept a sentence or a word when
each field is defined to have 20 bytes of data.

For eg.

When I enter the below values :-

/** first 20 bytes **
NAR = THIS IS TEST
/** sec. 20 bytes **
NAR1 = TO CHECK THIS
/ ** third 20 bytes **
NAR2 = CLIST IS WORKIN FINE

When I pass the above values from the panel , below is what happening :-

NAR = THIS
NAR1 = IS
NAR2 = TEST


Please assist me in letting me know how do i allow a 20 byte sentence to get mapped against the individual fileds shown above. The moment it encounters a space in the sentence it treats it as a next variable value which is not correct.

Code:
)ATTR                                                               
   @ AREA(SCRL)    EXTEND(ON)                                       
   # TYPE(TEXT)    INTENS(LOW)  COLOR(BLUE)                         
   | TYPE(TEXT)    INTENS(HIGH) COLOR(WHITE) SKIP(ON)               
   % TYPE(TEXT)    INTENS(HIGH) COLOR(YELLOW)                       
   ! TYPE(TEXT)    INTENS(HIGH) COLOR(GREEN)                         
   $ TYPE(INPUT)   INTENS(LOW)  JUST(LEFT)   CAPS(ON)               
   _ TYPE(INPUT)   INTENS(LOW)  JUST(LEFT) PADC('_') CAPS(ON)       
)BODY                                                               
|COMMAND ===>$ZCMD                                                   
|                                                                   
| |GAN NUMBER          :==>$Z             |   |GA  BSB   :==>$Z   | 
| |REFUND-DATE(YYMMDD) :==>$Z     |           |GAC NUMBER:==>$Z     
| |FMU IND             :==>$Z|                |Ref NUMBER:==>$Z     
| |Input file(Account,BSB,AMT):==>$Z                                 
| |Narrative           :==>_Z                   |                   
| |                        _Z                   |                   
| |                        _Z                   |                   
|                                                                   
|--------------------------------------------------------------------
@SCRL01                                                             
|                                                                   
)AREA SCRL01                                                         
|  !--- Refunds Sequence ---                                         
|                                                                   
|  |1.#Refund Extract for$Z                                         
|  |2.#AXIS BUILD                                                   
|                                                                   
|                                                                   
|                                                                   
)INIT                                                               
  &ZWINTTL = 'REFUNDS MENU'                                         
  .ZVARS = '(GAN BSB REFDATE GAC FMU REF DSN NAR NAR1 NAR2 BUDATE)' 
  .CURSOR = ZCMD                                                     
  .HELP = NLHAJ                                                     
)PROC                                         
  IF (&GAN ¬= ' ')                             
    VER (&GAN,PICT,NNNNNNNNNNNNNN,MSG=APSM000)
                                               
  IF (&BSB ¬= ' ')                             
    IF (&FMU ¬= 'Y')                           
      VER (&BSB,RANGE,2000,7999,MSG=APSM001)   
      &FMU = N                                 
                                               
  IF (&REFDATE ¬= ' ')                         
    VER (&REFDATE,PICT,NNNNNN,MSG=APSM002)     
                                               
  IF (&GAC ¬= ' ')                             
    VER (&GAC,PICT,NNNNNNNNN,MSG=APSM003)     
                                               
  IF (&FMU ¬= ' ')                             
    VER (&FMU,LIST,Y,N,MSG=APSM004)           
       IF (&FMU = 'Y')                         
         &BSB = 0000                           
                                               
  IF (&REF ¬= ' ')                             
    VER (&REF,DSNAME,MSG=APSM005)             
                                               
  IF (&DSN ¬= ' ')                             
    VER (&DSN,DSNAME,MSG=APSM007)             
                                               
  IF (&NAR ¬= ' ')                             
    VER (&NAR,INCLUDE,ALPHA,NUM,MSG=APSM006)   
                                               
  IF (&NAR1 ¬= ' ')                           
    VER (&NAR1,INCLUDE,ALPHA,NUM,MSG=APSM006) 
                                               
  IF (&NAR2 ¬= ' ')                           
    VER (&NAR2,INCLUDE,ALPHA,NUM,MSG=APSM006) 
                                               
  IF (&ZCMD ¬= ' ')                           
    VER (&ZCMD,LIST,1,2,MSG=APSM008)           
                                                                       
  IF (&ZCMD = 1)                                                       
    VER (&BUDATE,NONBLANK,MSG=APSM009)                                 
                                                                       
  IF (&ZCMD = 2)                                                       
    VER (&GAN,NONBLANK,MSG=APSM010)                                     
    VER (&REFDATE,NONBLANK,MSG=APSM010)                                 
    VER (&GAC,NONBLANK,MSG=APSM010)                                     
    VER (&FMU,NONBLANK,MSG=APSM010)                                     
    VER (&REF,NONBLANK,MSG=APSM010)                                     
    VER (&NAR,NONBLANK,MSG=APSM010)                                     
    VER (&DSN,NONBLANK,MSG=APSM010)                                     
                                                                       
  IF (&ZCMD = 2)                                                       
    IF (&NAR1 = ' ')                                                   
      &NAR1 = '                    '                                   
                                                                       
  IF (&ZCMD = 2)                                                       
    IF (&NAR2 = ' ')                                                   
      &NAR2 = '                    '                                   
                                                                       
  IF (&ZCMD = 2)                                                       
    IF (&FMU = 'N')                                                     
      VER (&BSB,NONBLANK,MSG=APSM010)                                   
                                                                       
  VPUT (GAN BSB REFDATE GAC FMU REF DSN NAR NAR1 NAR2 BUDATE) PROFILE   
                                                                       
)END                                                                   



Thank You,
Rajat
Back to top
View user's profile Send private message

daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Wed Jul 06, 2011 7:02 pm    Post subject:
Reply with quote

You have some options....

First off: Why do you have a VPUT as part of your Panel PROC section?
This is not necessary, nor is the VGET in your Rexx program. The information is passed automatically. There is no need to clutter the Profile pool.

I doubt this is an issue with the Zvars itself.

I suspect that there is some code in between the Display Panel and your say statements of the values. It would be nice to see that (hint hint).

So try removing the VPUT and VGET and try again. Show us the part of code around the Display and say statements.

Finally, Why not allow the narative to 60 characters all on one line? There is enough room, and would be easier for the user.
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Wed Jul 06, 2011 7:16 pm    Post subject: Reply to: How to define a ZVAR to accept sentence/word in Pa
Reply with quote

Actually Dave, I'm curious. If the panel issues the VPUT of the variables to the PROFILE pool, then what do these three variables look like at that point?
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Wed Jul 06, 2011 7:21 pm    Post subject:
Reply with quote

My guess is that immediately after the VGET in the Rexx, they are fine.

I think they are being passed to another program and then displayed.

This second pass is where they are being corrupted.

I could be wrong, but since the TS has deceided to show only very selected information, all of this is conjucture.

The reason for this assumption is, I encountered the same issue once.

I had to replace spaces with underscores before passing the sentences to the subroutine, then switch them back.
Back to top
View user's profile Send private message
rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 188
Location: india

PostPosted: Thu Jul 07, 2011 3:28 pm    Post subject:
Reply with quote

Hello,

I just identified where the issue exactly lies, its not in the panel but its in the Clist which passes the variables to the Proc clist which submits my JCL inturn :-

Below is the code :-


Clist for Panel REFMENU

Code:
PROC 1 BUDATE                                                           
/*CONTROL PROMPT NOFLUSH NOLIST NOCONLIST NOSYMLIST                     
  CONTROL PROMPT FLUSH MSG LIST CONLIST SYMLIST                         
                                                                       
    ISPEXEC VGET (GAN BSB REFDATE GAC FMU REF DSN BUDATE +             
                  NAR0120 NAR2140 NAR4160) PROFILE                     
                                                                       
/*      SET &GAN      =                                                 
/*      SET &BSB      =                                                 
/*      SET &REFDATE  =                                                 
/*      SET &GAC      =                                                 
/*      SET &FMU      =                                                 
/*      SET &REF      =                                                 
/*      SET &NAR0120  =                                                 
/*      SET &NAR2140  =                                                 
/*      SET &NAR4160  =                                                 
/*      SET &DSN      =                                                 
                                                                       
                                                                       
DISPLY: SET &ZCMD  =                                                   
        ISPEXEC ADDPOP                                                 
        ISPEXEC CONTROL ERRORS RETURN                                   
        ISPEXEC DISPLAY PANEL(REFMENU)                                 
        SET &RC = &LASTCC                                               
        ISPEXEC REMPOP                                                 
                                                                       
        IF     &RC =0 THEN GOTO PROCESS                                 
        ELSE IF &RC = 8 THEN GOTO RETURN                               
        ELSE IF &RC > 8 THEN DO                                         
             ISPEXEC SETMSG MSG(&ZERRMSG)                               
             GOTO RETURN                                               
        END                                                             
                                                                       
/**********************************************************************/
/*  MAIN PROCESS                                                      */
/**********************************************************************/
 PROCESS:  SELECT &ZCMD                                                 
           WHEN (1) %REFEXT &BUDATE                                     
           WHEN (2) GOTO REFAXIS                                       
           WHEN (CAN) GOTO RETURN                                       
           END                                                         
                                                                       
          GOTO DISPLY                                                   
                                                                       
REFAXIS: SET &NAR0120 = &STR(&NAR0120                    )             
         SET &NAR2140 = &STR(&NAR2140                    )             
         SET &NAR4160 = &STR(&NAR4160                    )             
         SET &NAR0120 = &STR(&SUBSTR(1:20,&NAR0120))                   
         SET &NAR2140 = &STR(&SUBSTR(1:20,&NAR2140))                   
         SET &NAR4160 = &STR(&SUBSTR(1:20,&NAR4160))                   
/*       SET &REFNAR  = &STR(&SUBSTR(1:20,&NAR0120))        *\         
/*       SET &REFNAR  = &STR(&REFNAR&SUBSTR(1:20,&NAR2140)) *\         
/*       SET &REFNAR  = &STR(&REFNAR&SUBSTR(1:20,&NAR4160)) *\         
         %REFAX &GAN,&BSB,&REFDATE,&GAC,&FMU,&REF,&DSN,  +             
         &BUDATE,&NAR0120,&NAR2140,&NAR4160                             
         GOTO DISPLY                                                   
                                                                       
                                                                       
RETURN:ISPEXEC VGET (GAN BSB REFDATE GAC FMU REF DSN BUDATE +           
                     NAR0120 NAR2140 NAR4160) PROFILE                   
EXIT



Clist Proc which submits the JCL :-

Code:
PROC 11 GAN,BSB,REFDATE,GAC,FMU,REF,DSN,BUDATE, +                     
        NAR0120,NAR2140,NAR4160                                       
  CONTROL PROMPT NOFLUSH NOLIST NOCONLIST NOSYMLIST                   
/*CONTROL PROMPT FLUSH MSG LIST CONLIST SYMLIST                       
/**************************************************************/     
/*                                                            */     
/* THIS CLIST CREATES AND SUBMITS JCL (FROM A SKELETON) TO    */     
/* EXECUTE AN AXIS FILE CREATION AND STATEMENT INSERTS        */     
/*                                                            */     
/**************************************************************/     
IF &SYSDSN('SPT2RS.AP.SUPPORT.ISPSLIB(REFAX)') ¬= OK THEN +           
 DO                                                                   
   WRITE MEMBER REFAX NOT FOUND IN SPT2RS.AP.SUPPORT.ISPSLIB         
   EXIT                                                               
 END                                                                 
        SET &REFDD   = &SUBSTR(5:6,&REFDATE)                         
        SET &REFMM   = &SUBSTR(3:4,&REFDATE)                         
        SET &REFYY   = &SUBSTR(1:2,&REFDATE)                         
        SET &REFNBOS = &STR(&REFDD/&REFMM/&REFYY)                     
                                                                     
/*  ISPEXEC VGET (GAN BSB REFDATE GAC FMU REF NAR DSN BUDATE) PROFILE
                                                                     
ISPEXEC VGET (ZTEMPF ZUSER)                                           
ISPEXEC FTOPEN TEMP                                                   
ISPEXEC LIBDEF ISPSLIB DATASET  +                                     
               ID('SPT2RS.AP.SUPPORT.ISPSLIB') +                     
                   STACK                                             
ISPEXEC FTINCL REFAX                                                 
ISPEXEC LIBDEF ISPSLIB  DATASET                                       
ISPEXEC FTCLOSE                                                       
SUBMIT '&ZTEMPF'           



The issue is that the variables are space delimited. What i mean to say is when these(NAR0120 NAR2140 NAR4160) are passed from Clist of REFMENU panel to JCL proc clist in the following manner

NAR0120 = Test to Check
NAR2140 = Code is
NAR4160 = Working fine

Then these are mapped to the JCL proc clist variables as

NAR0120 = Test
NAR0120 = To
NAR4160 = Check

The above variable fields are 20 bytes fields and which can contain space in between the data. But in Clist when the variables are passed to the PROC JCL it delimits itself to space (default maybe) and as soon as it encouters space it considers it a next variable. And the mapping get incorrect. Please assist me how do i make sure that entire stream of data is mapped correctly to individual fields when these are passed to my JCL clist PROC.


Thank You,
Rajat
Back to top
View user's profile Send private message
rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 188
Location: india

PostPosted: Thu Jul 07, 2011 3:36 pm    Post subject:
Reply with quote

Hello Dave,

What you mentioned is correct in my case as well, I am passing these variables from my panel clist to JCL which has easytrieve as instream where I use these variables to produce some files and reports for business. Please let me know how do we fix it.

Thank You,
Rajat
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1717
Location: UK

PostPosted: Thu Jul 07, 2011 5:06 pm    Post subject:
Reply with quote

In your clist (ugh - why not use Rexx?) as soon as you get the variables from the panel - add quotes at start and finish or the entire string.
Back to top
View user's profile Send private message
rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 188
Location: india

PostPosted: Thu Jul 07, 2011 5:25 pm    Post subject:
Reply with quote

Nic Clouston wrote:
In your clist (ugh - why not use Rexx?) as soon as you get the variables from the panel - add quotes at start and finish or the entire string.


Have tried that option already. But it is not working this way , I am facing the same situation.

Thank you,
Rajat
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Thu Jul 07, 2011 5:43 pm    Post subject:
Reply with quote

Rajat,

If you want my honest and experienced (25+ years) opinion...

Do not waste another second trying to debug these clists.

You can easily take the important bits (varable names, ISPEXEC statements), and create a single REXX exec to display the Panel, tailor the skeleton JCL, and submit it. A single program will remove the issue regarding the passing of parameters with imbedded spaces.

If you do not know Rexx, this is an easy application on which to learn.

IBM dropped clist in favor of Rexx, and so should you.

IBM made the switch in 1984, why are you using clist 27 years later?

Myself and others can help you with Rexx issues, clist help is much harder to find.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu Jul 07, 2011 6:52 pm    Post subject: Reply to: How to define a ZVAR to accept sentence/word in Pa
Reply with quote

that' s what You get by using CLISTs
Your chances of getting help on CLIST issues are pretty slim

to demonstrate that the issue is NOT ISPF related I took time to test it with rexx

see my example in this topic for the whole shebang REXX/PANEL/SKEL
http://www.ibmmainframes.com/viewtopic.php?t=55028&highlight=

and here is the PANEL CHANGED to use .ZVARS

Code:
 000001 )ATTR DEFAULT(%+_)                                                     
 000002       /*  % TYPE(TEXT) INTENS(HIGH)      defaults displayed for      */
 000003       /*  + TYPE(TEXT) INTENS(LOW)       information only            */
 000004       /*  _ TYPE(INPUT) INTENS(HIGH) CAPS(ON) JUST(LEFT)             */
 000005   $ TYPE(INPUT) INTENS(LOW) PAD(_)    /* input field padded with '_' */
 000006   ! TYPE(INPUT) INTENS(LOW) PAD(' ')  /* input field padded with ' ' */
 000007 )BODY                                                                   
 000008 %--------------------  TITLE FOR ENTRY PANEL  --------------------------
 000009 %COMMAND ===>_ZCMD                                                     
 000010 %                                                                       
 000011 +                  1         2         3         4         5           
 000012 +      12345678901234567890123456789012345678901234567890123456         
 000013 +   1 !z                                                       +       
 000014 +   2 !z                                                       +       
 000015 +   3 !z                                                       +       
 000016 +   4 !z                                                       +       
 000017 +                                                                       
 000018 )INIT                                                                   
 000019    .ZVARS = '(var1 var2 var3 var4)'                                     
 000020 )PROC                                                                   
 000021 )END                                                                   


TESTED AND WORKING
it customizes correctly even using variables/strings containing blanks/spaces

not an ISPF REXX issue... check Your programming icon_cool.gif
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1219
Location: Israel

PostPosted: Thu Jul 07, 2011 7:29 pm    Post subject:
Reply with quote

Your clist program does:
1. VGET
2. ADDPOP, DISPLAY PANEL and REMPOP
3. If RC is 0 and ZCMD is 2, you go to REFAXIS
4. in REFAXIS you call the 2nd clist program (the one with the submit).

In the VGET you are bringing values for NAR0120 NAR2140 NAR4160
In the panel you collect values in NAR NAR1 NAR2
Then you call REFAXIS with values in NAR0120 NAR2140 NAR4160

So maybe this is your problem...

On the other hand, maybe the problem is with passing parameters between the main program and REFAXIS.
The fact that the clist documentation uses '_' to link words in a sentence gives you a hint...
(Sorry, end of day for me, you will have to continue searching documentation without me... Going home right now!)

I agree with Dave. For me, rewriting the program in REXX will take less time than debugging the clist.
Back to top
View user's profile Send private message
rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 188
Location: india

PostPosted: Thu Jul 07, 2011 7:42 pm    Post subject:
Reply with quote

daveporcelan wrote:
I had to replace spaces with underscores before passing the sentences to the subroutine, then switch them back.


Hello Dave,

Thanks for the suggestion i will learn rexx but still please let me know how did you managed to replace spaces in the string of data with underscores before passing the sentences to the subroutine, then switch them back.

I would really like to learn that

Thank You,
Rajat
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Thu Jul 07, 2011 7:47 pm    Post subject:
Reply with quote

Well I did that in a REXX exec, and I do not know how to do that with a clist. I could figure it out I guess, but that would be a massive waste of my time.

So my FINAL advise is this:

Do not waste another second trying to debug these clists.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu Jul 07, 2011 7:52 pm    Post subject: Reply to: How to define a ZVAR to accept sentence/word in Pa
Reply with quote

meditate on this sentence from my previous answer
Your chances of getting help on CLIST issues are pretty slim
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Thu Jul 07, 2011 7:59 pm    Post subject:
Reply with quote

Quote:
I would really like to learn that


Why do you want to learn that?

Do you want to learn how to dry corn and grind it by hand?
Or do you go to the store and buy corn meal?

I have 25 years experience, Enrico probably has that amount as well.

Nic chimed in, as did Marso.

We are all giving you good advise, which you are choosing to ignore.

I am done with this thread.

Somebody please lock this and put it out of its misery.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jul 07, 2011 8:43 pm    Post subject: Reply to: How to define a ZVAR to accept sentence/word in Pa
Reply with quote

Hello Rajat,

You need to consider that there is a very big difference between persistence and merely being stubborn. . .

Several extremely well-qualified people have provided guidance that rexx will work far better for you than clist.

As requested, i'm locking this topic. . .

d
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies.    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 Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am
No new posts VSAM define for large file jerryte JCL & VSAM 9 Wed Oct 05, 2016 1:51 am
No new posts Rexx Panel Validation ajithajt CLIST & REXX 6 Sun Jul 17, 2016 10:50 pm
No new posts How to define PCB for paired segments ashok_uddaraju IMS DB/DC 4 Tue Jun 14, 2016 11:40 pm
No new posts Define Alias for multiple Data sets u... sandy98669 JCL & VSAM 4 Fri May 27, 2016 1:07 pm


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