There is a problem with all these methods -- they can fail if the variable
contains any of the special characters of significance to Pipelines or CMS.
This would include the stage separator character (usually '|'), the pipe end
character (often '?'), and possibly quotes and other special characters.
I have a trick to handle this:
Replace, for example,
'| SPECS /'thishost'/ 1' ,
'1-* Next',
'/'crdate'/ Next' ,
With
'| SPECS' safe(thishost)'/ 1' ,
'1-* Next',
safe(crdate)'/ Next' ,
Where 'safe' is a REXX function:
safe:
parse arg str
if str == '' then return '$$' /* Change to null */
else return 'x'c2x(str) /* Encode as xAABBCCDD...*/
It would be nice if SPECS had a function to insert a variable value directly,
for example:
'| SPECS var(thishost) 1' ,
'1-* Next',
'var(crdate) Next' ,
Maybe it does and I have missed it?
-----Original Message-----
From: CMSTSO Pipelines Discussion List [mailto:[email protected]] On
Behalf Of Mike Walter
Sent: Monday, July 28, 2014 9:45 AM
To: [email protected]
Subject: Re: [CMS-PIPELINES] Continuation from last post.
Miguel,
Remove the: '| SPECS /thishost/ 1 ',
(that just adds a record with ‘thishost’ before all the other records).
Then select any one of these:
1)
• After the FANINANY:
‘| INSERT /’thishost’/ BEFORE’ ,
‘| INSERT /’crdate’/ AFTER’ ,
Or 2)
• After the FANINANY:
‘| SPECS /’thishost’/ 1’ ,
‘1-* Next’,
‘/’crdate’/ Next’ ,
Or 3)
• Change the SPECS stages to:
‘| SPECS /’thishost’/ 1’ ,
‘21-28 9 41-48 19 29-32 29',
‘/’crdate’/ Next’ ,
And:
‘| SPECS /’thishost’/ 1’ ,
‘21-28 9 33-40 19 29-32 29',
‘/’crdate’/ Next’ ,
Three choices -- the last is most efficient, but the others broaden your
exposure to Pipes.
If you need a space after ‘thishost’, change ‘Next’ to ‘Nextword’, if you need
a space before ‘crdate’, again change its ‘Next’ to ‘Nextword’.
Mike Walter
Aon Corporation
The opinions expressed herein are mine alone, not necessarily those of my
employer.
-----Original Message-----
From: CMSTSO Pipelines Discussion List [mailto:[email protected]] On
Behalf Of Miguel Soltero Diaz
Sent: Monday, July 28, 2014 11:21
To: [email protected]
Subject: Re: Continuation from last post.
Hi guys,
I hit the send bottom too soon...
Basically I need to add the result of a CMS command at the beginning of each
record, and current date at the end of the record (or viceversa).
I want to execute the commands only ones, place them in a variable and insert
those variables in the pipe, before and after the SPECS ...
crdate = date(standard)
say 'date is ' crdate
thishost = strip(VMINQ(vmhost))
say 'host is ' thishost
'pipe (endchar ?)',
'< AUDIT EXTRCT1',
'| a1: locate (29-32) /0690/ ',
'| specs 21-28 9 41-48 19 29-32 29 ',
'| b: faninany',
'| > AUDIT SUBset3 A',
'? a1:',
'| a2: locate (29-32) /1090/ ',
'| SPECS 21-28 9 33-40 19 29-32 29',
'| b: '
would like to insert THISHOST to the beginning of each record and CRDATE at the
end of the same...
How can I do this?
Thank you...
Miguel
----------------------------------------------------------------------
This message, and any attachments, is for the intended recipient(s) only, may
contain information that is privileged, confidential and/or proprietary and
subject to important terms and conditions available at
http://www.bankofamerica.com/emaildisclaimer. If you are not the intended
recipient, please delete this message.