|
RE: Re: DOW vs DOU- Ha On May 28 1997 Jim Welsh wrote: >>I prefer this method John. >> <<< Blah blah snip >>>> >> KEY CHAIN FILEXXX >> *IN90 DOWEQ *OFF While a record >> XXXCODE ANDNE 'B' & not code B >> EXSR CHKRCD Check Record >> GOODR IFEQ 'Y' Process ? >> <.... whatever process ....> >> ENDIF End Process >> KEY READE FILEXXX 90 Read Next >> ENDDO >> >>C* Check Record Subroutine >> CHKRCD BEGSR >> MOVE 'Y' GOODR >> XXXCODE IFEQ 'A' >> MOVE 'N' GOODR >> ENDIF >> ENDSR >This works fine when there are only 2 data types, A and not A. The problem >with this approach, however, is that type A does not really equate to "not >good", and type not A does not equate to "good". Each is a "good" type >within the iteration of mixed type A and type not A records. Type A records >simply have no processing to be done. >Later on the spec. might change and we would have to perform some work on >type A records after all. Or we may need to do different processing for type >X and type Y. That's why SELEC or CAS are the best codes to use within the >loop. They are an exact match for the structure of the data. (I've gone >right off ITER in the last couple of days for obvious reasons.) :-) <snip> >Dave Kahn - Tengizchevroil, Kazakstan -------------------------------------------------------------------------- Dave; That is correct. The "A" type records are valid selections, They just don't have any further processing to be done(TODAY). The example's intent (HA, I still have to laugh, I'm sorry. But you'd have to admit it was funny. BTW I told charlie(who also made the mistake I believe) that I had to print yours off and read it over acouple of times with a cup of coffee just to enjoy it. Yes I intentionally "put the pail over the door" , thanks for opening it), aaaanyway where was I, the example's intent was just for your benefit(so to speak). The rational that I believe is most important is to "Separate the Controling Logic from the Data Manipulation Logic!" If I really had a senerio where, while(until imean:-)) reading a file I had some records to process, and some not to. I'd perform a subroutine for the records to be processed. I would not mix (with few exceptions) data manipulation(adds,divides, Eval's, etc.) with the controlling logic (If, else, when, case, etc.). This makes enhancements much easier, New selects or other conditions could be added easily in their section, and other data manipulations could be done in their section. "Think of the s/he comming behind you" Enhanceability is #1 P.S. I orginally used "FILEXXX" and XXXCODE" so that people would see that the variable came from the record just read. In some cases I guess I was wrong. John Carr CDP EdgeTech 5921 Acorn Ridge CT. Midlothian VA 23112 74711.77@compuserve.com Ph 804-739-7689 Fax 804-739-7950 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This is the Midrange System Mailing List! To submit a new message, * * send your mail to "MIDRANGE-L@midrange.com". To unsubscribe from * * this list send email to MAJORDOMO@midrange.com and specify * * 'unsubscribe MIDRANGE-L' in the body of your message. Questions * * should be directed to the list owner / operator: david@midrange.com * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.