IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to store Values in coumpound varible used in CLIST?


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
aditi panse

New User


Joined: 19 May 2009
Posts: 9
Location: Poona

PostPosted: Thu Jun 04, 2009 11:58 am
Reply with quote

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
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Thu Jun 04, 2009 12:03 pm
Reply with quote

AD 2009 you don't write CLIST, you write REXX
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Jun 04, 2009 12:16 pm
Reply with quote

prino wrote:
AD 2009 you don't write CLIST, you write REXX

A comment whole heartedly agreed with.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Thu Jun 04, 2009 7:22 pm
Reply with quote

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
View user's profile Send private message
aditi panse

New User


Joined: 19 May 2009
Posts: 9
Location: Poona

PostPosted: Fri Jun 05, 2009 12:02 pm
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Fri Jun 05, 2009 7:26 pm
Reply with quote

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
View user's profile Send private message
aditi panse

New User


Joined: 19 May 2009
Posts: 9
Location: Poona

PostPosted: Mon Jun 08, 2009 10:35 am
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Mon Jun 08, 2009 10:56 pm
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Jun 09, 2009 1:59 am
Reply with quote

  1. On your panel, variables are numbered from 0 to 9. Your clist loop goes from 1 to 10.

  2. 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.

  3. BCNT is used for...?

  4. The WRITE command displays your assignment, maybe it (the assignment) is not executed.
    This line is suspicious.

  5. Why do you attempt to "retrieve the values of SMEMB4 and SMEMB7"? and how??

  6. Why, but why, in CLIST? now I have dust everywhere (due to point #4).
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Jun 09, 2009 3:27 am
Reply with quote

Nice Link, Marso...
Back to top
View user's profile Send private message
aditi panse

New User


Joined: 19 May 2009
Posts: 9
Location: Poona

PostPosted: Fri Jun 12, 2009 11:35 am
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Fri Jun 12, 2009 4:33 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
Search our Forums:

Back to Top