× 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.



I am doing something similar in RPG IV

I read a file to get the file, Field Value and Optional Condition  
(This is for Updating EDI Qualifiers and Otherwise hardcoded Values by
Trading Partner)
I have a portion of the File Name included to ensure that it is only
running on a certain file set so FLEVEL Contains the File Suffix 
But you can Remove the Hardcoded Prefix and Have Flevel be the File Name


 C     GetDft        BEGSR

 C                   Movel     '810'         DOCTYP

 C     DFTKEY        SETLL     EDIDFT

 C                   IF        %EQUAL

 C                   DOU       %EOF

 C     DFTKEY        READE     EDIDFT                                 41

 C                   IF        NOT %EOF

  /FREE

     If DftCnd = *blanks;

     SqlStmt = 'UPDATE SI810' + %TRIM(FLEVEL) + ' SET ' + %TRIM(DOCSEG)

    + ' = ' + sq + %TRIM(SEGVAL) + sq +' WHERE TPID = ' + sq + DftID +
sq;                    
     else;

     SqlStmt = 'UPDATE SI810' + %TRIM(FLEVEL) + ' SET ' + %TRIM(DOCSEG)

    + ' = ' + sq + %TRIM(SEGVAL) + sq +' WHERE TPID = ' + sq + DftID +
sq                     
    + ' AND ' + DftCnd;

     endif;

  /END-FREE

 C/EXEC SQL

 C+   EXECUTE IMMEDIATE: SqlStmt

 C/END-Exec

 C*                 -------

 C                   ENDIF

 C                   ENDDO


Sample of EDIDFT:
TPID  CAT                                           
DOCTYP  810   
FLEVEL  D01                
DOCSEG  IT106                            
COND  IT106 = ''                                                  
SEGVAL  BP


Michael Ala




As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.