Try using a "here" document like this in the z/OS Unix shell:

# a "here" document with 10,000 60-byte lines:
wc <<EOB
line 1 x x x x x x x xx x xx x xx x x x x x x xx x xx x x x xx x x x xx x x
x x x
line 2 x x x x x x x xx x xx x xx x x x x x x xx x xx x x x xx x x x xx x x
x x x
...
line 10,000 x x x x x x x xx x xx x xx x x x x x x xx x xx x x x xx x x x
xx x x
EOB

Most users will find that this causes U4088 abends, with this error from
the shell:
FSUM9225 no memory: EDC5132I Not enough memory. (errno2=0xC5070003)

That amount of input seems pretty small to run out of memory, doesn't it?
If you have used z/OS C/C++ much you might have seen this kind of
surprising thing if you ever use "realloc()".  The LE Heap manager by
default does a lousy job of repeatedly increasing the size of an existing
heap allocation.  In classical IBM style, instead of fixing the heap
manager they decided to add an environment variable that gives you a
complicated control that might allow you to work around the problem.

We took a guess that realloc() was the problem with the shell, and sure
enough if you set this envar *before* running the shell, then the here
document works as expected:

export _CEE_REALLOC_CONTROL=32K,25

Kirk Wolf
Dovetailed Technologies
http://dovetail.com

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to