On Wed, 22 Dec 2021 00:20:19 +0000, Farley, Peter x23353 wrote: >I keep various awk "function packages" in separate members in the PDS. Each >one has functions I may use in the real program, which is always the last one >in the concatenation. > ... >Also, z/OS awk does not (I think) support the gawk "@include" functionality >that allows one to keep such function packages in separate files but not have >to mention them on the awk command line (multiple "-f" parameters and file >names on the awk command line does effectively the same thing as the >concatenated DD I use). > Do awk functions need to be declared in the BEGIN rule? I've always done so. I've never written awk so complex that I felt need for "@include". If I did I think I'd just wrap the awk in a shell script and embed the functions with "$( ... )".
What advantage do you see in PDSE members over UNIX directory members which I find more natural and portable to my desktop. For Rexx I've used DD concatenation and copied the result to a temp PDS(E) with IEBGENER or REPRO in an IKJ* driver. It's convenient that each function can contain a test driver which is bypassed by the RETURN in the main program which is often a SYSIN. Again, I find UNIX members more convenient because I can test each function-member with a single command; no JCL or SDSF needed. > ... Typical JCL example: > >//AWKSPLIT EXEC PGM=BPXBATSL,MEMLIMIT=256M, >// PARM='PGM /bin/awk --f //DD:SCRIPT //DD:TEXTIN' >//STDOUT DD DISP=(NEW,CATLG,CATLG), >// DSN=output.qsam.file,.name, >// UNIT=TEST,SPACE=(CYL,(1,1),RLSE), >// DSORG=PS,RECFM=VB,LRECL=8004,BLKSIZE=0,BUFNO=31 >//STDERR DD SYSOUT=* >//SCRIPT DD DISP=SHR,DSN=TSOUSER.TEST.AWK(CSVSPLIT) >// DD DISP=SHR,DSN=TSOUSER.TEST.AWK(STRFUNCS) >// DD DISP=SHR,DSN=TSOUSER.TEST.AWK(STRFTIME) >// DD DISP=SHR,DSN=TSOUSER.TEST.AWK(MKTIME) >// DD DISP=SHR,DSN=TSOUSER.TEST.AWK(NEWTESTS) >//TEXTIN DD DISP=SHR,DSN=input.qsam.or.pds.with.member.name, >// BUFNO=31 >//STDIN DD DUMMY >// > >My awk scripts are kept in a normal PDSE created using the IBM1047 code page >(ISPF terminal type 28, 3278L1). Thanks, gil ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
