27.12.2012 Views

OpenVMS System Management Techniques, Tools ... - OpenMPE

OpenVMS System Management Techniques, Tools ... - OpenMPE

OpenVMS System Management Techniques, Tools ... - OpenMPE

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

A good PIPE example<br />

$! Counting records in a file<br />

$!!cnt.com<br />

$!! usage: @cnt <br />

$!!<br />

$ if p1 .eqs. "" then inquire/nopunctuation p1 "Enter Filename: "<br />

$ PIPE ( SEARCH 'p1' somegarbage /statistics | -<br />

SEARCH SYS$PIPE "records searched" | -<br />

( READ SYS$PIPE $TMP$ ; DEFINE/JOB/NOLOG $TMP$ &$TMP$ ) ) ; -<br />

RECORD_COUNT == -<br />

F$element(2," ",f$edit(F$trnlnm("$TMP$"),"TRIM,COMPRESS")) ; -<br />

DEASSIGN/JOB $TMP$<br />

$ WRITE SYS$OUTPUT "''F$Fao("!/ Record count is: !AS",RECORD_COUNT)'"<br />

$ EXIT<br />

$!<br />

$!Example:<br />

$!$ @cnt sys$login:login.com<br />

$!<br />

$! Record count is: 70<br />

HP World 2004 - Seminar 4063 62

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!