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 

trying to use associated memory in rexx

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


Joined: 12 Aug 2005
Posts: 30
Topics: 10

PostPosted: Thu Jun 29, 2006 11:37 am    Post subject: trying to use associated memory in rexx Reply with quote

The following rexx exec under TSO/ISPF is not doing what I expected; the value put into the array should be what I get out of it; this not happening and I can't see what I am doing wrong:
Code:

000001 /* REXX ------------------------------------------------------------ */
000002 /*      NDVARRAY                                                     */
000003 /*      builds an associated array from:                             */
000004 /*      A2FH.NDVADMIN.NDVAPALL.SUMMARY                               */
000005 /* CBLPSE2  used  299 times by: Stage PRO2 system FIN                */
000006 /*                                                    A2FH 06/29/06  */
000007 /* ----------------------------------------------------------------- */
000008   x=msg(off)                                                           
000009   address tso                                                           
000010   "FREE  F(SUMMARY)"                                                   
000011   "ALLOC F(SUMMARY) DS(NDVADMIN.NDVAPALL.SUMMARY) SHR"                 
000012   "EXECIO * diskr summary(finis stem sum."                             
000013   "FREE  F(SUMMARY)"                                                   
000014   /* build associate memory array for pgrp/stage/system */             
000015   sgrp.sstg.ssys.='0'                                                   
000016   do i=1 to sum.0                                                       
000017     sgrp=strip(substr(sum.i,1,8))                                       
000018     sstg=strip(substr(sum.i,36,4))                                     
000019     ssys=strip(substr(sum.i,48,3))                                     
000020     ssum=strip(substr(sum.i,15,4))                                     
000021     sgrp.sstg.ssys=ssum                                               
000022   /*say sgrp' 'sstg' 'ssys' = 'ssum*/                                 
000023     xsum=sgrp.sstg.ssys                                               
000024     say '>>'sgrp' 'sstg' 'ssys' = 'xsum                               
000025     if i>15 then leave                                                 
000026   end                                                                 
000027     say 'now try to use this array:'                                   
000028 /* CBLPSE2  used  299 times by: Stage PRO2 system FIN                */
000029     sgrp='CBLPSE1'; sstg='DEV1'; ssys='FIN'                           
000030     xsum=sgrp.sstg.ssys                                               
000031     say '>>>>'sgrp' 'sstg' 'ssys' = 'xsum                             
000032     sgrp='CBLPSE1'; sstg='FIX1'; ssys='FIN'                           
000033     xsum=sgrp.sstg.ssys                                               
000034     say '>>>>'sgrp' 'sstg' 'ssys' = 'xsum                             
000035     sgrp='CBLPSE1'; sstg='PRO2'; ssys='FIN'                           
000036     xsum=sgrp.sstg.ssys                                               
000037     say '>>>>'sgrp' 'sstg' 'ssys' = 'xsum                             
000038     sgrp='CBLPSE2'; sstg='PRO2'; ssys='FIN'                             
000039     xsum=sgrp.sstg.ssys                                                 
000040     say '>>>>'sgrp' 'sstg' 'ssys' = 'xsum                               
000041     sgrp='CBLPSE4'; sstg='PRO2'; ssys='FIN'                             
000042     xsum=sgrp.sstg.ssys                                                 
000043     say '>>>>'sgrp' 'sstg' 'ssys' = 'xsum                               
000044   exit 0       

===> TSO NDVARRAY gives this result:
                                                       
>>AION PRO1 MDA = 0       
>>AION PRO2 MDA = 1       
>>CBLPSE1 DEV1 FIN = 2     
>>CBLPSE1 FIX1 FIN = 13   
>>CBLPSE1 PRO2 FIN = 7     
>>CBLPSE2 PRO2 FIN = 299   
>>CBLPSE4 PRO2 FIN = 12   
>>CBLPSW1 DEV1 FIN = 1     
>>CBLPSW1 PRO2 FIN = 7     
>>CBLPSW2 DEV1 FIN = 5     
>>CBLPSW4 DEV1 FIN = 1     
>>CIIDB PDL2 ADV = 11     
>>CIIDB PDS2 ADV = 4       
>>CIIDB DEV1 CPS = 1       
>>CIIDB PRO1 CPS = 1       
>>CIIDB PRO2 CPS = 4       
now try to use this array:
>>>>CBLPSE1 DEV1 FIN = 1   
>>>>CBLPSE1 FIX1 FIN = 13 
>>>>CBLPSE1 PRO2 FIN = 7   
>>>>CBLPSE2 PRO2 FIN = 7   
>>>>CBLPSE4 PRO2 FIN = 7   
***                       

The values obtained do not match the creation value?
Back to top
View user's profile Send private message Send e-mail
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Thu Jun 29, 2006 2:26 pm    Post subject: Reply with quote

sgrp is the root 'node' and its value is not substituted. Try adding one more qualifier to the left, like nodes.sgrp.sstg.ssys
Back to top
View user's profile Send private message Visit poster's website
linhofbiker
Beginner


Joined: 12 Aug 2005
Posts: 30
Topics: 10

PostPosted: Thu Jun 29, 2006 2:37 pm    Post subject: Reply with quote

Thanks - that works, but I don't understand why
Code:

- - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 22 Line(s) not Displayed
000021     nodes.sgrp.sstg.ssys=ssum                                           
- - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  1 Line(s) not Displayed
000023     xsum=nodes.sgrp.sstg.ssys                                           
- - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  6 Line(s) not Displayed
000030     xsum=nodes.sgrp.sstg.ssys                                           
- - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  2 Line(s) not Displayed
000033     xsum=nodes.sgrp.sstg.ssys                                           
- - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  2 Line(s) not Displayed
000036     xsum=nodes.sgrp.sstg.ssys                                           
- - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  2 Line(s) not Displayed
000039     xsum=nodes.sgrp.sstg.ssys                                           
- - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  2 Line(s) not Displayed
000042     xsum=nodes.sgrp.sstg.ssys                                           
- - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  2 Line(s) not Displayed


>>AION PRO1 MDA = 0       
>>AION PRO2 MDA = 1       
>>CBLPSE1 DEV1 FIN = 2     
>>CBLPSE1 FIX1 FIN = 13   
>>CBLPSE1 PRO2 FIN = 7     
>>CBLPSE2 PRO2 FIN = 299   
>>CBLPSE4 PRO2 FIN = 12   
>>CBLPSW1 DEV1 FIN = 1     
>>CBLPSW1 PRO2 FIN = 7     
>>CBLPSW2 DEV1 FIN = 5     
>>CBLPSW4 DEV1 FIN = 1     
>>CIIDB PDL2 ADV = 11     
>>CIIDB PDS2 ADV = 4       
>>CIIDB DEV1 CPS = 1       
>>CIIDB PRO1 CPS = 1       
>>CIIDB PRO2 CPS = 4       
now try to use this array:
>>>>CBLPSE1 DEV1 FIN = 2   
>>>>CBLPSE1 FIX1 FIN = 13 
>>>>CBLPSE1 PRO2 FIN = 7   
>>>>CBLPSE2 PRO2 FIN = 299
>>>>CBLPSE4 PRO2 FIN = 12 
***
Back to top
View user's profile Send private message Send e-mail
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