Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

REXX file read limit

997 views
Skip to first unread message

Jay Pillai

unread,
Dec 11, 2000, 9:21:34 AM12/11/00
to
Is there a limit how big a file, rexx can read?. I have written a program
which reads a file,
formats this input and creates an output file which is an input for
another program. I was wondering
if the input file gets too big, if my program will still function or will
it end with 'Machine resource exhausted'. as it does
when I run this rexx program in a foreground session.

Thanks in advance for your reply.

Jay

Khan, Moyeen , M.A.

unread,
Dec 11, 2000, 9:26:46 AM12/11/00
to
Instead reading the entire file, you could either read record by record or
chunk of records.

One Hand Clapping

unread,
Dec 11, 2000, 1:23:58 PM12/11/00
to
yes... since the file is read into the queue, or into stem records, the "size"
limit is that imposed by how much memory is available to the logged on user or
batch job.

Jay Pillai wrote:

> Is there a limit how big a file, rexx can read?. <snip>

Isaac Yassin

unread,
Dec 11, 2000, 3:33:47 PM12/11/00
to
Hi,
As long as you don't do it one-by-one (too much I/O) - I use about 5000
records per EXECIO (sometimes I cheat myself and read more...)

Isaac Yassin

Jay Pillai

unread,
Dec 13, 2000, 8:16:01 AM12/13/00
to
How can I read chunk of 5000 records from a file, do some processing, and
the next 5000 and so on till
the end of file. At the moment I do it like this. I am afraid if the
file gets too big Rexx could have a problem reading
the whole file at one go.

"execio * diskr indd (stem file. finis"
do i = 1 to file.0
/* some file processing done here and written to output
file */

End

Jay

Seibert, Dave

unread,
Dec 13, 2000, 8:50:42 AM12/13/00
to
Hi Jay,
What the other responders to your question implied but didn't outright
state is that the Memory Exhausted problem is typically caused by excessive
memory tied up by variables.
Here is an example of avoiding that.
The program can be passed a heapsize parameter which controls how many
records are read in a chunk.
The critical part of freeing memory is the >drop ttlin.i< statement. This
is an old program. The more current version deals with more complications,
but this program was short enough to post.
The program reads a file (allocated outside this program) and changes a
portion of the record to uppercase, then writing it out to another file
(also allocated outside this program).
Excuse any syntax errors. They have to have been caused by adding comments.
Feel free to reply with questions.

/* Rexx */

arg heapsize Tr_parm

If Tr_parm <> '' then /* Set
debugging option if requested */
do;trace_on=1;Tr_stmt='TRACE 'Tr_parm;interpret Tr_stmt;end
else trace_on = 0

if heapsize = '' | heapsize = '.' then
heapsize = 1000 /* set default
heapsize if nulled or not supplied */

curr_line = 1;done = 0; j=0 /* initialize looping vars.
*/

do until done
"execio "heapsize" diskr ttlin" curr_line" (stem ttlin."
if rc = 2 then done = 1

do i = 1 to ttlin.0
up_name = translate(substr(ttlin.i,9,210))
outrec.i = overlay(up_name,ttlin.i,221,210)
end /* end do ttlin loop */

if trace_on then interpret Tr_stmt /* Debugging code */

drop ttlin.
outrec.0 = i - 1

"execio" outrec.0 "diskw outrec (stem outrec."
say writing Outrec.0 records
curr_line = curr_line + ttlin.0

end /* end outer loop */

"execio 0 diskw outrec (finis"

David Seibert
Compuware Corporation File-AID Product Architect
Dave.S...@Compuware.com

Thomas Berg

unread,
Dec 13, 2000, 8:22:54 AM12/13/00
to

Something like:

rcode = 0

do Until rcode <> 0
"execio 5000 diskr indd (stem file."
rcode = rc


do i = 1 to file.0
/* some file processing done here and written to output file */
End

End

"execio 0 diskr indd (finis"


Thomas Berg

Jay Pillai skrev:

thomas.berg.vcf

Erik P. Olsen

unread,
Dec 13, 2000, 8:49:33 AM12/13/00
to

n = 5000
Do Forever
"execio" n "diskr indd (stem file."
eof? = rc=2


do i = 1 to file.0
/* some file processing done here and written to output file
*/
End

If eof? Then Leave


End
"execio 0 diskr indd (finis"


Er...@epo.dk

Gozzard, Mark

unread,
Dec 13, 2000, 5:36:43 PM12/13/00
to
A generic sample:-

"ALLOC F(XXXX) DA("DSN") SHR"
CALL GET_RECORDS
DO WHILE FILE.0 > 0
DO XX = 1 TO FILE.0
CALL DO_WORK FILE.XX
END
CALL GET_RECORDS
END
"EXECIO 0 DISKR XXXX (FINIS"
"FREE F(XXXX)"
EXIT

GET_RECORDS:
"EXECIO 10000 DISKR XXXX(STEM FILE."
RETURN

DO_WORK: PROCEDURE
PARSE ARG RECORD
/* PROCESS YOU RECORD HERE !!!! */
SAY RECORD
RETURN


Mark Gozzard
Mailto:mark.g...@eds.com


-----Original Message-----
From: Jay Pillai [mailto:Jay_P...@SWISSRE.COM]
Sent: 13 December 2000 23:43
To: TSO-...@VM.MARIST.EDU
Subject: REXX file read limit

0 new messages