× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi,

The setll put the pointer before the first record : OK
The %eof after a settl does not work like you mean, tou do not read with a
setll
the read must be changed by a reade or you must test the fields read and if
not the same as thhe keys make a leave.
instead of  if not %eof use if  %equal

----- Original Message ----- 
From: "Brian Piotrowski" <bpiotrowski@xxxxxxxxxxxxxxx>
To: "RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx>
Sent: Friday, January 12, 2007 6:16 PM
Subject: SetLLs and Logical File Issues


Hi List,



I'm having a Friday afternoon brain cramp, and I'm wondering if someone
can offer advice?



I have a logical file composed of three fields (SST05A7):

RAPLCD (Plant Code)

RAQRL (Quick Receive Serial Number)

RACSN (Serial Number)



I have a key (QRLKEY) defined in my program as:

PLCD (Plant Code)

QRLNO (Quick Receive Serial Number)



When I use the SQL interpreter and check a specific QRL number and plant
code against the logical file, I get back 13 records.  However, when I
run the following code, I get back the 13 records plus a whole bunch of
other records that are not associated with the same QRL.  Anyone have
any ideas where I am going wrong, I'd appreciate some comments.  Code
snippet is to follow.  Thanks!



///



          if LABELTYPE = 'QRL';

            setll QRLKEY sst05a7;

            if not %eof(sst05a7);

              read sst05a7;

              DoW not %eof(sst05a7);

      /end-free

     C* Get the current part name

     C/Exec SQL

     C+ Select PNPTNM, PNSUPP, PNSPLC into

     C+ :partname, :suppnum, :supploc from ssm05

     C+ where pnplcd = :raplcd and pnptno = :raptno

     C+ and pnptcl = :raptcl

     C/End-exec

     C*

      /free

                If SQLCod = 100;

                  partname = '';

                  suppnum = '';

                  supploc = '';

                endif;

                select;

                  when stockloc = 'P1';

                    SSTOCKLOC='1';

                  when stockloc = 'P2';

                    SSTOCKLOC='2';

                  when stockloc = 'QC';

                    SSTOCKLOC='C';

                  when stockloc = 'TR';

                    SSTOCKLOC = 'T';

                endsl;

                serialno = racsn;

                osdatein = %timestamp;

                osdateout = *loval;

                write oss_fmt;

                read sst05a7;

              ENDDO;

      /end-free

     C*

     C* Add the location to SST05

     C/Exec SQL

     C+ UPDATE SST05a4 set RASF01=:SSTOCKLOC

     C+ where raplcd = :plcd

     C+ and raqrl = :QRLNO

     C/End-exec

     C*

      /free



            ENDIF;

///



/b;



-=-=-=-=-=-=-=-=-=-=-=-=-=-

Brian Piotrowski

Assistant Mgr. - I.T.

Simcoe Parts Service, Inc.

Ph: 705-435-7814 x343

Fx: 705-435-6746

-=-=-=-=-=-=-=-=-=-=-=-=-=-



-- 
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.