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.
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)
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
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.
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
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?
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
/* 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
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)
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.
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.
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
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.
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.
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.
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
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.