I’m supposing that you had a good value for :SZIP
and SINNME = %VALLEY%
SELECT * FROM F0101JN WHERE ALADDZ = :SZIP
C+ AND ABALPH LIKE :SINNME ORDER BY ABAN8
If I were doing it interactively I would have to type
‘%VALLEY%’ with the quotes so I expect the the value you need in SINNME is
SINNME = '%VALLEY%'
SINNME = ''' + SINNME + '''
and is ALADDZ char or numeric?
Remember this will only find upper case values.
This code works for me:
* #csr_prep subroutine - begin
c #csr_prep begsr
c eval select_str = 'SELECT ITMNUM, ITDESC '
c + 'FROM FPITMMAS'
c if filter <> *blanks
c eval select_str = %trim(select_str) + ' WHERE '
c + 'ITDESC LIKE ''%' + %trim(filter)
c + '%'''
c eval select_str = %trim(select_str)
c + ' ORDER BY ITMNUM'
c+ PREPARE SELECT_STMT FROM :select_str
c+ DECLARE SUBFILE_CSR CURSOR FOR SELECT_STMT
c+ OPEN SUBFILE_CSR
* #csr_prep subroutine - end
Kevin C. Ketzler