16.12.2012 Views

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

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.

END {<br />

print "\t Jan\t Feb\tMarch\tApril\t May\t" \<br />

"June\tJuly\t Aug\tSept\t Oct\t Nov\t Dec"<br />

for (prod = 1; prod 1 ? OFS : ORS)<br />

}<br />

12. The following program prints the input files from the command line. The infiles<br />

function first empties the passed array, and then fills the array. The extra<br />

parameter i of infiles is a local variable.<br />

function infiles(f,i) {<br />

for (i in f)<br />

delete f[i]<br />

for (i = 1; i < ARGC; i++)<br />

if (index(ARGV[i],"=") == 0)<br />

f[i] = ARGV[i]<br />

}<br />

BEGIN {<br />

infiles(a)<br />

for (i in a)<br />

print a[i]<br />

exit<br />

}<br />

13. Here is the standard recursive factorial function:<br />

function fact(num) {<br />

if (num

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

Saved successfully!

Ooh no, something went wrong!