As opposed to the folly of testing at the top of the loop when that will give incorrect results? You've got to carve the bird at the joints, and no two birds are created equal. Blindly following dogmatic rules will cause errors in your code.
-- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 ________________________________________ From: IBM Mainframe Discussion List <[email protected]> on behalf of Paul Gilmartin <[email protected]> Sent: Tuesday, May 29, 2018 3:42 PM To: [email protected] Subject: Re: empty KSDS behavior - why? On Tue, 29 May 2018 19:12:32 +0000, Frank Swarbrick wrote: >Test 1 - both DVFJS.DUMMY1 and DVFJS.DUMMY2 are "un-initialized" (HI-U-RBA is >0): > > REPRO IDS(DVFJS.DUMMY1) ODS(DVFJS.DUMMY2) >IDC3300I ERROR OPENING DVFJS.DUMMY1 >IDC3351I ** VSAM OPEN RETURN CODE IS 160 >IDC0005I NUMBER OF RECORDS PROCESSED WAS 0 >IDC3003I FUNCTION TERMINATED. CONDITION CODE IS 12 > >Test 2 - after adding a record to DVFJS.DUMMY1, and then deleting the record >(HI-U-RBA is now 829440): > > REPRO IDS(DVFJS.DUMMY1) ODS(DVFJS.DUMMY2) >IDC0005I NUMBER OF RECORDS PROCESSED WAS 0 >IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 0 > >In this latter case DVFJS.DUMMY2 remains "un-initialized" (HI-U-RBA is still >0). > And I suppose it still ABENDs if you attempt to read a record or to REPRO again DUMMY2 to DUMMY3? Ugh! I believe this demonstrates the utter folly of testing at the bottom of a loop rather than at the top. A WHILE loop doesn't attempt to access a record when there is none; an UNTIL loop attempts to process one record regardless. I'm not very sympathetic to the argumemt of performance, that UNTIL performs the test N times but WHILE performs it N+1. Imagine "ls" or "dir" or "BLDL"'s ABENDing on an empty directory! (Does ISPF member list still report an error on an empty directory, or just show an empty screen except for header lines?) -- gil ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
