View previous topic :: View next topic |
Author |
Message |
linhofbiker Beginner
Joined: 12 Aug 2005 Posts: 30 Topics: 10
|
Posted: Thu Jun 29, 2006 11:37 am Post subject: trying to use associated memory in rexx |
|
|
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 |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Thu Jun 29, 2006 2:26 pm Post subject: |
|
|
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 |
|
 |
linhofbiker Beginner
Joined: 12 Aug 2005 Posts: 30 Topics: 10
|
Posted: Thu Jun 29, 2006 2:37 pm Post subject: |
|
|
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 |
|
 |
|
|