View previous topic :: View next topic
|
Author |
Message |
aditi panse
New User
Joined: 19 May 2009 Posts: 9 Location: Poona
|
|
|
|
Hi
I am writing code for a nested CLIST. This CLIST also calls an ISPF panel.
This panel contains 10 fields which I need to store in compound variable. I can insert data in any of these 10 fields. the panel looks like as follows.
Code: |
1. 2. 3. 4. 5.
6. 7. 8. 9. 10.
|
I am using 2 compound variables in the code.
1. SMEMB (&&SMEMB&CNT)
2. DMEMB (&&DMEMB&DCNT)
One compound variable is used to test if any data exist in the field. And second compound variable is used to store that data.
I am using following code to store the values in the compound variable DMEMB.
Code: |
DO WHILE &CNT < 10
SET SMEMB = &&SMEMB&CNT
IF &SMEMB NE THEN +
DO
SET DCNT = &DCNT+1
SET DMEMB = &&SMEMB&CNT
WRITE ROUND &CNT &&DMEMB&DCNT = &DMEMB
SET MEMCNT = &MEMCNT+1
END
ELSE +
SET BCNT = &BCNT+1
SET CNT = &CNT+1
END
END
|
In this code, if SMEMB is not spaces that means a value exist in the field.
Here DCNT is the counter for compound variable DMEMB.
I am trying to display the values stored in DMEMB using below code, I am not able to display any stored values.
Code: |
SET COUNTER = &DCNT
DO &DCNT = 1 TO &COUNTER
WRITE MEMBER &DCNT = &DMEMB
END
|
The problem I am facing here is the values which are taken from ISPF panel
are not getting stored in the compound variable DMEMB.
Could you suggest any alternative way which can be used to store these values?
or how to store and retrieve values from a compound variable? |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1315 Location: Vilnius, Lithuania
|
|
|
|
AD 2009 you don't write CLIST, you write REXX |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
prino wrote: |
AD 2009 you don't write CLIST, you write REXX |
A comment whole heartedly agreed with. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
Quote: |
The problem I am facing here is the values which are taken from ISPF panel are not getting stored |
If that is the problem, then that is what you need to show us. You did not show the panel source which saves the values. |
|
Back to top |
|
|
aditi panse
New User
Joined: 19 May 2009 Posts: 9 Location: Poona
|
|
|
|
hi
in the panel i am using compound variable &&SMEMB&CNT.
there are 10 fields for SMEMB as follows:
Code: |
1._SMEMB0 + 2._SMEMB1 + 3._SMEMB2 + 4._SMEMB3 +
5._SMEMB4 + 6._SMEMB5 + 7._SMEMB6 + 8._SMEMB7 +
9._SMEMB8 + 10._SMEMB9 +
|
in the panel it will look like follows:
Code: |
1. 2. 3. 4.
5. 6. 7. 8.
9. 10.
|
i am trying to save these values in another compound variable named DMEMB. here user can input values at random places, for instance
your had inserted values on
SMEMB4 snd SMEMB7
i want to store these two values in DMEMB. I am using folloeing code to store these values in DMEMB.
Code: |
DO WHILE &CNT < 10
SET SMEMB = &&SMEMB&CNT
IF &SMEMB NE THEN +
DO
SET DCNT = &DCNT+1
SET DMEMB = &&SMEMB&CNT
WRITE ROUND &CNT &&DMEMB&DCNT = &DMEMB
SET MEMCNT = &MEMCNT+1
END
ELSE +
SET BCNT = &BCNT+1
SET CNT = &CNT+1
END
END
|
however when i an trying to retrieve the values of SMEMB4 and SMEMB7
I am able to retrieve only the last value, which belongs to SMEMB7.
I hope my query is clear now. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
Quote: |
in the panel i am using compound variable &&SMEMB&CNT. |
I am not sure what that means. I do not think you can use a compound variable in a panel in the way you have implied.
Can you show us your actual panel source (second request)? |
|
Back to top |
|
|
aditi panse
New User
Joined: 19 May 2009 Posts: 9 Location: Poona
|
|
|
|
This is the source for the panel:
Code: |
)ATTR DEFAULT(%+_)
¬ TYPE(INPUT) INTENS(NON)
! TYPE(OUTPUT) INTENS(LOW) COLOR(YELLOW)
@ TYPE(TEXT) INTENS(HIGH) COLOR(YELLOW)
ä TYPE(TEXT) INTENS(HIGH) COLOR(RED)
/* */
)BODY EXPAND(\\)
%COMMAND ===>_ZCMD +
+
%S@- Submit job
+
+ Program Details
+ Name %==>+1._SMEMB0 + 2._SMEMB1 + 3._SMEMB2 + 4._SMEMB3 +
+ %==>+5._SMEMB4 + 6._SMEMB5 + 7._SMEMB6 + 8._SMEMB7 +
+ %==> + 9._SMEMB8 + 10._SMEMB9 +
|
I hope I have given you the right information this time. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
Quote: |
i am trying to save these values in another compound variable |
Your clist code do not show where you are saving the value TO a compound variable. Please elaborate.
Your panel looks fine. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
- On your panel, variables are numbered from 0 to 9. Your clist loop goes from 1 to 10.
- For your intermediate values, you use variables that have names similar to your "compound variables".
This creates an unnecessary confusion, and definitely leads to programming mistakes.
- BCNT is used for...?
- The WRITE command displays your assignment, maybe it (the assignment) is not executed.
This line is suspicious.
- Why do you attempt to "retrieve the values of SMEMB4 and SMEMB7"? and how??
- Why, but why, in CLIST? now I have dust everywhere (due to point #4).
|
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Nice Link, Marso... |
|
Back to top |
|
|
aditi panse
New User
Joined: 19 May 2009 Posts: 9 Location: Poona
|
|
|
|
Hi Pedro,
sorry for the late reply.
i am using DMEMB as another variable to store values of my compound variable 'SMEMB' .
I am using below code to store SMEMB values:
Code: |
DO
SET DCNT = &DCNT+1
SET DMEMB = &&SMEMB&CNT
END
|
Here DCNT is the counter used for compund variable DMEMB.
please let me know if this code is right.
thanks,
Aditi |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
Your code shows that you refer to compound variable SMEMBxx, but as for DMEMB, there is only one such variable. Though, you probably set it several times. It will only remember the last value that you set.
That is, you somehow need to specify the compound name in a SET statement, and to the left of the equal sign. I am not sure CLIST will allow that use.
You have not really indicated why you continue to use clist instead of rexx. As others have stated, rexx is the better choice and would be easier in this instance. |
|
Back to top |
|
|
|