I used cat/grep/awk because I saw it used so often by people in the
unix/linux team I used to work with. Maybe it was just a quirk of that
group, or like our JCL where once someone codes it everyone else copies it.
Bill Woodger wrote:
Tom,
I think if you use that cat to grep to awk as an example, you'll get confusion from the
students. They'll say "why don't you just do it in awk?" or even reel off an
obscure Perl one-liner.
Using ls into grep into tail may be more realistic.
On Thursday, 4 February 2016 20:00:36 UTC, Tom Brennan wrote:
That's great stuff, and how mainframe methods need to be taught today.
College students understand unix and windows, and need to know the (can
I say odd?) differences they will see on the mainframe, along with a bit
of history.
I'm currently trying to write up some notes for some (possible) new
mainframers who already know unix, and this is one of my comparisons:
Unix Style:
cat /etc/passwd | grep ^ted013: | awk -F':' '{print $3}'
JCL Style:
//CAT EXEC PGM=CAT
//SYSUT1 DD DSN=SYS1.ETC.PASSWD,DISP=SHR
//SYSUT2 DD DSN=&TEMP1,DISP=(NEW,PASS),SPACE=(CYL,(1,1))
//*
//GREP EXEC PGM=GREP
//SYSUT1 DD DSN=&TEMP1,DISP=(OLD,DELETE)
//SYSUT2 DD DSN=&TEMP2,DISP=(NEW,PASS),SPACE=(CYL,(1,1))
//SYSIN DD *
^ted013:
/*
//AWK EXEC PGM=AWK
//SYSUT1 DD DSN=&TEMP2,DISP=(OLD,DELETE)
//SYSUT2 DD SYSOUT=*
//SYSIN DD *
awk -F':' '{print $3}'
/*
Of course we don't normally have MVS programs named CAT/GREP/AWK but I'm
hoping to show how we chain programs together using JCL, and relate that
to unix commands that a student today already knows well. Then I just
have to try and explain why it takes 16 lines of JCL to do the same
thing as one line in unix :)
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN