× 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

There are a couple of things that jump out at me with this bit of code:

0320.00 C                   WRITE     FOOTER
0321.00 C                   EXFMT     CUSTMTCTL
0322.00 C**  IF F5 IS PRESSED PROCESS POSSITION VALUE
0323.00 C                   IF        *IN05=*ON
0324.00 C                   DOW       %EOF(CUSTDISP)

First, the DOW structure will never be processed because the %EOF(CUSTDISP)
will not be returned as a true condition.  I think that what you want to
achieve is to read each changed subfile record and process that, in which
case you should replace the DOW statement with a DOU version:

        C                   DOU       %EOF(CUSTMT)

I'm assuming here that CUSTMT is your subfile format and not your customer
master file.

0325.00 C                   READC     CUSTMT

Because we changed the DOW to a DOU you need to check that a subfile record
was found before doing any of your validation/update processing, so you need
to add:

        C                   IF        %FOUND(CUSTMT)

At this point I would expect the program to fall over on the next statement.
If the UPDATE CUSTREC is referring to your database file then you need to
read the record first using, presumably, fields from the subfile record to
chain to the file:

        C     KEY           CHAIN     CUSTMAST        
        C                   IF        %FOUND(CUSTMAST)

And then moving the subfile record fields to the database record fields (for
example):

        C                   EVAL      CustCODE = sflCODE
        C                   EVAL      CustNAME = sflNAME
        C                   EVAL      CustTEL  = sflTEL

0326.00 C                   UPDATE    CUSTREC
0327.00 C                   IF        FLAG='U'
0328.00  **  CALL ROUTINE TO UPDATE SKU DETAIL
0329.00 C*                  EXSR      MTUPDATE
0330.00 C                   ELSEIF    FLAG='D'
0331.00  **  CALL ROUTINE TO DELETE A RECORD
0332.00 C*                  EXSR      MTDELETE
0333.00 C                   ENDIF

Then add in the two ENDIF's to close the additional clauses we've added:

        C                   ENDIF
        C                   ENDIF

0334.00 C                   ENDDO
0335.00 C*                  IF        MTPOSVAL = ' '

Hope it helps

All the best

Jonathan



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.