× 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 Aaron,

No need for the Do and Iters. This is a straight Select Group.

     C     Customer      CHAIN(n)  CSTMST1                            99
      *
     C                   if        *IN99
                          
     C                   CLEAR     *ALL          RCSTMST
      *
     C                   Select
     C                   When      (BSi = 0)
     C                   eval      WSTEXT = 'Bill-To information is required' +
     C                                      'for new customer.'
     C                   EXSR      $Error
      *
     C                   When      (BSBZP(1) = ' ')
     C                   eval      WSTEXT = 'Bill-To information is ' +
     C                                      'incomplete for new customer.'
     C                   EXSR      $Error
      *
     C                   Other
     C     OrigCust      CHAIN(n)  CSTMST1                            98
      *
     C                   if        (*IN98)
     C                   CLEAR     *ALL          RCSTMST
     C                   eval      WSTEXT = 'Default customer record not ' +
     C                                      'found.'
     C                   EXSR      $Error
     C                   endif
                       
     C                   EndSl
      *
     C                   WRITE     RCSTMST
     C                   endif

----- Original Message ----- 
From: "Bartell, Aaron L. (TC)" <ALBartell@xxxxxxxxxxxxxx>
To: "'RPG programming on the AS400 / iSeries'" <rpg400-l@xxxxxxxxxxxx>
Sent: Monday, February 16, 2004 10:54 PM
Subject: RE: ITER, LEAVE, GOTO - dirty opcodes? was ->RE: NOTO (or "no GOTO i n 
FreeForm RPG")


> >I should know better than to enter this discussion but ...
> I thought the same thing, LOL!
> 
> Just curious, what would you do differently with the following code?  Notice
> how I have a DO loop (without conditions) wrapping this entire section of
> code.  If an error is encountered I call the $Error subroutine and ITER my
> way out of the loop to avoid more errors.  This goes back to my second email
> where I said I should have had more ITERs within my loop.
> 
>      C                   do
>      C     Customer      CHAIN(n)  CSTMST1                            99
>       *
>      C                   if        (not *IN99)
>      C                   ITER
>      C                   else
>      C                   CLEAR     *ALL          RCSTMST
>       *
>      C                   if        (BSi = 0)
>      C                   eval      WSTEXT = 'Bill-To information is required
> ' +
>      C                                      'for new customer.'
>      C                   EXSR      $Error
>      C                   ITER
>      C                   endif
>       *
>      C                   if        (BSBZP(1) = ' ')
>      C                   eval      WSTEXT = 'Bill-To information is ' +
>      C                                      'incomplete for new customer.'
>      C                   EXSR      $Error
>      C                   ITER
>      C                   endif
>       *
>      C     OrigCust      CHAIN(n)  CSTMST1                            98
>       *
>      C                   if        (*IN98)
>      C                   CLEAR     *ALL          RCSTMST
>      C                   eval      WSTEXT = 'Default customer record not ' +
>      C                                      'found.'
>      C                   EXSR      $Error
>      C                   ITER
>      C                   endif
>       *
>      C                   WRITE     RCSTMST
>      C                   endif
>       *
>      C                   enddo  
> 
> 
> _______________________________________________
> 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.