SELECT IF statement and serial read

Raymond Schneider balddaddyray@yahoo.com
Mon, 21 Sep 1998 12:32:24 -0700 (PDT)


Hello all,

I am developing a QUICK screen to serially read an IMAGE Master
dataset and display the entries on the screen. The key on the dataset
is 10 characters, for sake of this discussion let's call it AGPROGSTAF
(it is called APSNO in the code).  I want to ask the user for the AG
field and the PROG field, then serially read the dataset selecting
only the requested AG values and requested STAF values (the PROG
values are variable).

It appears that no records are being selected when the SELECT IF
statement is included, but when it is commented out, then all records
are displayed (not restricted by any criteria).

The complete code follows:
SCREEN APSMAST.HQOBJ  ACTIVITIES FIND

TEMPORARY WHAT-AG CHAR*2
TEMPORARY WHAT-STAFF CHAR*4

FILE APSMAST OCCURS 10
  ACCESS SEQUENTIAL
    SELECT IF (AGENCY OF APSMAST EQ WHAT-AG  AND  &
              STAFF OF APSMAST EQ WHAT-STAFF)
FILE STAFPERS SECONDARY OCCURS WITH APSMAST
  ACCESS VIA APSNO USING (AGENCY OF APSMAST + "0000" +  &
                        STAFF OF APSMAST)

TITLE "STAFF PERSON IN PROGRAM CENTERS" AT 4,20

SKIP 1
ALIGN  (,5,12)  (,15,21)
FIELD WHAT-AG LABEL"AGENCY"
FIELD WHAT-STAFF LABEL"STAFF"

SKIP 2
TITLE " AG   PROG   STAFF   BEGIN   END" AT ,1
TITLE "STAFF NAME" AT ,40
SKIP 1

ALIGN (,,2)  (,,8)  (,,14)  (,,20)  (,,30)  (,,40)  (,,60)
CLUSTER  OCCURS WITH APSMAST
FIELD AGENCY OF APSMAST REQUIRED NOCHANGE
FIELD PROGRAM OF APSMAST REQUIRED NOCHANGE
FIELD STAFF OF APSMAST REQUIRED NOCHANGE
FIELD DTBEG OF APSMAST
FIELD DTEND OF APSMAST
FIELD NMLAST OF STAFPERS
FIELD NMFRST OF STAFPERS
CLUSTER

PROCEDURE PATH
   BEGIN
     PROMPT WHAT-AG
     PROMPT WHAT-STAFF
    INFORMATION="   Please wait -- this will take 20 seconds"   &
                  + " AG: " + WHAT-AG + " STAFF: " + WHAT-STAFF  NOW
     LET PATH = 1
     END
PROCEDURE FIND
  BEGIN
    FOR APSMAST
      BEGIN
       GET APSMAST SEQUENTIAL
       GET STAFPERS OPTIONAL
      END
  END

BUILD DETAIL LIST

The proper values for WHAT-AG and WHAT-STAFF are displayed in the
INFORMATION statement.

What am I doing wrong?
==
Raymond B. Schneider		(513)621-3045
Hamilton County Mental Health Board	(513)632-7159 fax
801-A W. 8th Street			H-P 3000  MPE/iX 5.0
Cincinnati, OH  45203-1601		Powerhouse 7.09E
rays@hamilton.mh.state.oh.us


_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
This list is closed, thus to post to the list, you must be a subscriber.