I thought that perhaps an anecdote about a similar issue might be interesting, since of course you're to get a lot of philosophical answers from greater minds than I.
A question came up on one of the mainframe beginner lists. Someone who was new to Rexx wanted to be able to create a program to replicate a lot of DB2 bind cards changing only the creator field. This could be done in Rexx but would be a bit wordy and a lot for a beginner. A much better solution would be to use ISPF file tailoring, but that gets into ISPF services with Rexx and would be even more difficult for a beginner. Instead I proposed about a 4 or 5 line shell script using sed with instructions on how to cp the resulting files to a PDS. He didn't know Unix but that's another story. Would a "pure" shell script be another option for you? It might be both more elegant and more readable. Lindy -----Original Message----- From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On Behalf Of McKown, John Sent: 14. heinäkuuta 2008 18:39 To: [email protected] Subject: Which is better? question about CGI program. This is likely more a philosophical question. I am writing a CGI in REXX. One thing this program needs to do is read a number of files in a specific subdirectory. My current approach is to use "pure" REXX code to do this. This means reading the entire directory (using "address syscall readdir") to get a list of the files in the subdirectory into a stem variable. I am then using an "address syscall readfile" in a loop to read the contents of the each file. Each file has a single record in it. I am then searching the second field in that record to see if it contains a specific string, entered by the user via a Web page. The fields in each record are separated by tab ('05'x) characters. Altogether, omitting the error checking, this takes about 15 lines of REXX code. However, I have alternate method. The REXX program uses BPXWUNIX to run an "awk" program to do the search. The "awk" program is only 4 lines long. The plus of this is that it is much shorter. The minuses are that: (1) it uses BPXWUNIX to fork/exec an awk program; (2) it uses "awk" which nobody else on my team is familiar with. So, should I go with the longer pure REXX program which is possibly more understandable? Or should I go with the REXX/awk hybrid which is, in some ways, simpler but has more overhead? This is likely going to be a low use program. -- John McKown Senior Systems Programmer HealthMarkets Keeping the Promise of Affordable Coverage Administrative Services Group Information Technology The information contained in this e-mail message may be privileged and/or confidential. It is for intended addressee(s) only. If you are not the intended recipient, you are hereby notified that any disclosure, reproduction, distribution or other use of this communication is strictly prohibited and could, in certain circumstances, be a criminal offense. If you have received this e-mail in error, please notify the sender by reply and delete this message without copying or disclosing it. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html

