Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Passing a variable/value to Rexx
Goto page Previous  1, 2
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
Author Message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 13611
Location: 221 B Baker St

PostPosted: Fri Jun 26, 2009 2:40 am    Post subject:
Reply with quote

Hello,

You should not be running this in rexx. . . .
Back to top
View user's profile Send private message
References
d_pansare

New User


Joined: 25 Apr 2009
Posts: 21
Location: Pune

PostPosted: Fri Jun 26, 2009 1:50 pm    Post subject:
Reply with quote

Quote:

If the dataset has more number of records, REXX variable is not able to store and throwing an error message as 'unable to obtain storage'.



You got this kind of error because you must be reading the whole file in an array and getting your record count using value present in '0' th node. This will work unless and until your array does't take the storage space more than 2MB ( 2 MB is the threshold storage limit for REXX program variables ).

If upfront you are aware that size of your file is more thab 2 mb then don't read the entire file rather keep reading one by one record until you reach the end of file...

Let me know if you would like to have the code to count the record....

_________________

Always there to give and take the HELP !!!!!
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 5414
Location: italy

PostPosted: Fri Jun 26, 2009 1:54 pm    Post subject: Reply to: Passing a variable/value to Rexx
Reply with quote

Quote:
2 MB is the threshold storage limit for REXX program variables

please quote or give the link to the manual where You read that
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 6469
Location: Brussels once more ...

PostPosted: Fri Jun 26, 2009 2:06 pm    Post subject:
Reply with quote

And also pay attention to the comment of Dick above.

I await your reply to Enricos request eagerly, having processed files of over 10Mb in the past.
Back to top
View user's profile Send private message
d_pansare

New User


Joined: 25 Apr 2009
Posts: 21
Location: Pune

PostPosted: Fri Jun 26, 2009 4:31 pm    Post subject:
Reply with quote

Apologies.. I quoted the wrong figure..

Here is the snapshot of what is mentioned in TSO/E REXX reference manual..

<<<<<<<<<<<<<<<<<<<<<<

There is no limit to the length of the values of variables, as long as all variables fit
into the storage available.
Implementation maximum: No single request for storage can exceed the fixed
limit of 16 MB. This limit applies to the size of a variable plus any control
information. It also applies to buffers obtained to hold numeric results.

>>>>>>>>>>>>>>>>>>>>>>>>

Here is the link ...

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/IKJ4A370/2.0?DT=20060626210253

So if this true then one cannot write the whole file to array if the size is more than 16MB....

Again sorry for the confusion as far as actual storage is concerned...




[/url]
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 5414
Location: italy

PostPosted: Fri Jun 26, 2009 4:36 pm    Post subject: Reply to: Passing a variable/value to Rexx
Reply with quote

do a bit of rereading, please
the 16MB limit is for a single variable, not for an array ( wrong term anyway ) as a whole
each entry of an array ( as You call it ) is a variable

( the right term would be a STEMMED variable )

each [stemmed] variable ( apart a few bytes of control info ) can be up to 16 MB

how many variables You can define and use depends on the virtual storage avilable
Back to top
View user's profile Send private message
ug123
Warnings : 1

New User


Joined: 01 Mar 2007
Posts: 39
Location: Chennai

PostPosted: Fri Jun 26, 2009 8:00 pm    Post subject: Reply to: Passing a variable/value to Rexx
Reply with quote

Dick, I appologies for not responding. Please let me know other than rexx how can we do that...

This is what I am doing currently.
DSN='HLQ.XXXX'
"ALLOC DA('"DSN"') F(OUTDD) SHR"
"EXECIO 0 DISKR OUTDD(OPEN"
"EXECIO * DISKR OUTDD(STEM I."

COUNT = 0
DO LIN = 1 TO I.0
COUNT = COUNT + 1
END
ZEDLMSG = 'TOTAL RECORDS:' || COUNT
"ISPEXEC SETMSG MSG(ISRZ001)"

"EXECIO 0 DISKR OUTDD(FINIS"
"FREE F(OUTDD)"

Please give some code if anything is wrong in the above code.


Thanks,
Ugandar...
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 5414
Location: italy

PostPosted: Fri Jun 26, 2009 8:09 pm    Post subject: Reply to: Passing a variable/value to Rexx
Reply with quote

edited to correct my first wrong impression
Quote:
nothing wrong from a REXX syntactic point of view,


why in <heaven> the loop
Code:
COUNT = 0
DO LIN = 1 TO I.0
COUNT = COUNT + 1
END

at the end count will be equal to i.0
are You trying to be real sure that things match icon_biggrin.gif icon_confused.gif

the approach is wrong because an "EXECIO * READ .... (STEM ...."
will try to read in memory all the records and trying to manage in rexx more than a few thousandths records will give a poor performance from any point of view.

if there is a real business need to have an interactive count the most performing approach would be to invoke from rexx Your sort product
to count the records, writing a single output record with the result

and then in rexx read the single line displaying the result

see the jcl/dfsort forums on samples about counting records

but, I really see a little need to find out in an interactive way the record count
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 HoursGoto page Previous  1, 2
Page 2 of 2