On Wed, 6 Mar 2019 at 05:51, Bishop, Peter <[email protected]> wrote:
> Glenn, > > Thanks so much. I can see I've a lot to learn! I'll try these out when > I'm back in the office tomorrow and let you (and the other readers) know. > Indeed, there's always something new to learn. While Glenn is right with the more robust example to avoid code injection, the modern appendage somewhat closer to what you were doing is is with STRLITERAL IFEMPTY like | locate ... | strliteral ifempty /No data found/ | cons In this case, STRLITERAL passes all input records to its output stream, but if no records were passed, it writes the specified string to the output instead. Since you should always learn something more than what you were looking for, the COND option tells STRLITERAL to produce the string only when there are some records to pass. That's ideal when you need a header like "These users have linked the minidisk" and think it is silly to show that when there are no users. Sir Rob the Plumber
