On Friday, 06/24/2016 at 02:20 GMT, "Gentry, Steve" <steve.gen...@westernsouthernlife.com> wrote: > I'm not getting the results I'd expect when STACK is the first in a pipeline. What I thought > would happen is the entire STACK is read into the stream and then proceed onto the next stage. > This is not happening. Here is my code: > 'PIPE stack' , > '| take 1' , > '| spec 33.8 1' , > '| var EXPDT' > > I will have at least three lines in the stack. These three lines are created by another command > that uses the " STACK FIFO" (w/o the quotes). > What appears to happen, with my code, is only one line is taken from the stack. Then the usual > happens when there are more lines in the stack. When the PIPE ends, CMS fusses about invalid > commands because the remaining stack items are seen as commands by CMS. > I get around this by issuing another PIPE STACK command, see below: > 'PIPE stack' , > '| hole'
I guess the question is whether you want your program to get all the data in the stack, or if you want it to just grab the first item and throw the rest away. If the latter, 'MAKEBUF' stacklevel = rc /* Do things with the stack here */ 'DROPBUF' stacklevel This ensures that you don't leave debris on the stack. Think of MAKEBUF as CMS placing a "porous" bookmark on top of the stack. Items placed in the stack FIFO go in at the bookmark. (Note that this doesn't protect data already on the stack.) The DROPBUF (with the stack level) discards anything remaining above the bookmark and removes the bookmark. Alan Altmark Senior Managing z/VM and Linux Consultant Lab Services System z Delivery Practice IBM Systems & Technology Group ibm.com/systems/services/labservices office: 607.429.3323 mobile; 607.321.7556 alan_altm...@us.ibm.com IBM Endicott