Re: Simple PIPE ?

2007-02-28 Thread Rob van der Heij

On 2/28/07, Huegel, Thomas [EMAIL PROTECTED] wrote:

How can a be sure NEWNAME is being set to '' (null) if nothing makes it that
far through the pipe?


The classic probably is   ...  | append literal | var newname

But more exciting is to look at what you're going to do with it after
than and see whether that will also fit in the pipeline... ;-)

Rob


Re: Simple PIPE ?

2007-02-28 Thread Hughes, Jim - OIT
This works for me.

Newname = ''

'PIPE FILERAND TOM222 PLI A  1-10', 
'| FIND --CATAL= ',
'| TAKE FIRST 1',  
'| SPECS 9.9 1',   
'| STRIP', 
'| VAR NEWNAME tracking' 

 


Jim Hughes
603-271-5586
There's no sense in being precise when you don't even know what you're
talking about.
John von Neumann 



From: The IBM z/VM Operating System [mailto:[EMAIL PROTECTED] On
Behalf Of Huegel, Thomas
Sent: Wednesday, February 28, 2007 10:17 AM
To: IBMVM@LISTSERV.UARK.EDU
Subject: Simple PIPE ?

 

I think this should be really simple, but the brain doesn't seem to be
working this morning. 
I have this little pipe, and the last stage is '|VAR NEWNAME'. 
How can a be sure NEWNAME is being set to '' (null) if nothing makes it
that far through the pipe? 

'PIPE FILERAND TOM222 PLI A  1-10', 
'| FIND --CATAL= ',
'| TAKE FIRST 1',  
'| SPECS 9.9 1',   
'| STRIP', 
'| VAR NEWNAME' 

Thanks.

 

__ 
 ella for Spam Control  has removed VSE-List messages and set aside
VM-List for me 
You can use it too - and it's FREE!  http://www.ellaforspam.com 



Re: Simple PIPE ?

2007-02-28 Thread Mike Walter
While I certainly agree with Sir Rob about the right thing to do see 
whether that will also fit in the pipeline, here's another technique that 
I've been know to use:

newname='' /* Set to null before running Pipe */
... whatever ...,
'| VAR newname TRACKING'

For more help, issue PIPE HELP VAR (or if not running the CMS Pipelines 
Runtime Library: HELP PIPE VAR)

Mike Walter 
Hewitt Associates 
Any opinions expressed herein are mine alone and do not necessarily 
represent the opinions or policies of Hewitt Associates.




Rob van der Heij [EMAIL PROTECTED] 

Sent by: The IBM z/VM Operating System IBMVM@LISTSERV.UARK.EDU
02/28/2007 10:22 AM
Please respond to
The IBM z/VM Operating System IBMVM@LISTSERV.UARK.EDU



To
IBMVM@LISTSERV.UARK.EDU
cc

Subject
Re: Simple PIPE ?






On 2/28/07, Huegel, Thomas [EMAIL PROTECTED] wrote:
 How can a be sure NEWNAME is being set to '' (null) if nothing makes it 
that
 far through the pipe?

The classic probably is   ...  | append literal | var newname

But more exciting is to look at what you're going to do with it after
than and see whether that will also fit in the pipeline... ;-)

Rob




 
The information contained in this e-mail and any accompanying documents may 
contain information that is confidential or otherwise protected from 
disclosure. If you are not the intended recipient of this message, or if this 
message has been addressed to you in error, please immediately alert the sender 
by reply e-mail and then delete this message, including any attachments. Any 
dissemination, distribution or other use of the contents of this message by 
anyone other than the intended recipient 
is strictly prohibited.


Re: Simple PIPE ?

2007-02-28 Thread Rich Greenberg
On: Wed, Feb 28, 2007 at 09:16:38AM -0600,Huegel, Thomas Wrote:

} I think this should be really simple, but the brain doesn't seem to be
} working this morning.
} I have this little pipe, and the last stage is '|VAR NEWNAME'.
} How can a be sure NEWNAME is being set to '' (null) if nothing makes it that
} far through the pipe?
} 
} 'PIPE FILERAND TOM222 PLI A  1-10',
} '| FIND --CATAL= ',
} '| TAKE FIRST 1',  
} '| SPECS 9.9 1',   
} '| STRIP', 
} '| VAR NEWNAME' 

The easiest way is to change the VAR stage to a STEM stage, like:

  '| STEM NEWNAME.'

At the end of the pipe, NEWNAME.0 will contain the number of items that
reached the STEM, and NEWNAME.1, NEWNAME.2 etc will contain the item(s).

-- 
Rich Greenberg  N Ft Myers, FL, USA richgr atsign panix.com  + 1 239 543 1353
Eastern time.  N6LRT  I speak for myself  my dogs only.VM'er since CP-67
Canines:Val, Red, Shasta  Casey (RIP), Red  Zero, Siberians  Owner:Chinook-L
Retired at the beach Asst Owner:Sibernet-L


Re: Simple PIPE ?

2007-02-28 Thread Rob van der Heij

On 2/28/07, Macioce, Larry [EMAIL PROTECTED] wrote:


I don't know pipes well, but I would set newname  to null first everytime
then what happens happens


Sure? I would expect CMS Pipelines to drop the variable when no record
flows there.

Rob


Re: Simple PIPE ?

2007-02-28 Thread Rob van der Heij

On 2/28/07, Mike Walter [EMAIL PROTECTED] wrote:


'| VAR newname TRACKING'


Cheating !  ;-)

Since the var stage will also pass the records along, I sometimes do
it like this:
  ...
 | var response
 | take | count lines | var worktodo

if worktodo then ...

Rob


Re: Simple PIPE ?

2007-02-28 Thread Huegel, Thomas
Thanks, this will work for me too.
'tracking' somehow it seems the meaning must have lost something in
translation.

-Original Message-
From: The IBM z/VM Operating System [mailto:[EMAIL PROTECTED]
Behalf Of Hughes, Jim - OIT
Sent: Wednesday, February 28, 2007 10:28 AM
To: IBMVM@LISTSERV.UARK.EDU
Subject: Re: Simple PIPE ?



This works for me.

Newname = ''

'PIPE FILERAND TOM222 PLI A  1-10', 
'| FIND --CATAL= ',
'| TAKE FIRST 1',  
'| SPECS 9.9 1',   
'| STRIP', 
'| VAR NEWNAME tracking' 

 


Jim Hughes
603-271-5586
There's no sense in being precise when you don't even know what you're
talking about.
John von Neumann 


  _  


From: The IBM z/VM Operating System [mailto:[EMAIL PROTECTED] On
Behalf Of Huegel, Thomas
Sent: Wednesday, February 28, 2007 10:17 AM
To: IBMVM@LISTSERV.UARK.EDU
Subject: Simple PIPE ?

 

I think this should be really simple, but the brain doesn't seem to be
working this morning. 
I have this little pipe, and the last stage is '|VAR NEWNAME'. 
How can a be sure NEWNAME is being set to '' (null) if nothing makes it that
far through the pipe? 

'PIPE FILERAND TOM222 PLI A  1-10', 
'| FIND --CATAL= ',
'| TAKE FIRST 1',  
'| SPECS 9.9 1',   
'| STRIP', 
'| VAR NEWNAME' 

Thanks.

 

__ 
 ella for Spam Control  has removed VSE-List messages and set aside
VM-List for me 
You can use it too - and it's FREE!  http://www.ellaforspam.com
http://www.ellaforspam.com  


  _  

 ella for Spam Control  has removed 10245 VSE-List messages and set
aside 8305 VM-List for me
You can use it too - and it's FREE!   www.ellaforspam.com
http://www.ellaforspam.com


Re: Simple PIPE ?

2007-02-28 Thread Mike Walter
Yes, cheating.  Sometimes cheating is OK.  ;-)
Another alternative (to be considered only after determining if the 
process could be better handled in the pipe itself):

...pipe stuff...
'| VAR newname'
If symbol('NEWNAME')='VAR' /* 'NEWNAME' must be in quotes and IIRC 
capitalized */
   then go ahead and use the variable as set by the pipe
   else the variable was not set, take appropriate action

I confess to using TRACKING or symbol('VARNAME_WHATEVER') depending on how 
clear my mind is at the moment.
Symbol() is probably a more clean technique, but Rich's STEM solution 
works well to (esp. with a 'TAKE 1' stage before it).

Mike Walter 
Hewitt Associates 
Any opinions expressed herein are mine alone and do not necessarily 
represent the opinions or policies of Hewitt Associates.




Rob van der Heij [EMAIL PROTECTED] 

Sent by: The IBM z/VM Operating System IBMVM@LISTSERV.UARK.EDU
02/28/2007 10:53 AM
Please respond to
The IBM z/VM Operating System IBMVM@LISTSERV.UARK.EDU



To
IBMVM@LISTSERV.UARK.EDU
cc

Subject
Re: Simple PIPE ?






On 2/28/07, Mike Walter [EMAIL PROTECTED] wrote:

 '| VAR newname TRACKING'

Cheating !  ;-)

Since the var stage will also pass the records along, I sometimes do
it like this:
   ...
  | var response
  | take | count lines | var worktodo

if worktodo then ...

Rob



 
The information contained in this e-mail and any accompanying documents may 
contain information that is confidential or otherwise protected from 
disclosure. If you are not the intended recipient of this message, or if this 
message has been addressed to you in error, please immediately alert the sender 
by reply e-mail and then delete this message, including any attachments. Any 
dissemination, distribution or other use of the contents of this message by 
anyone other than the intended recipient 
is strictly prohibited.