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

Instead of using SUBST have you though about using a 64x1 character array to
process the flags.  For example:

     E                    FLG        64  1

     E* Work array for customer flags...

 

 

     C*

     C* Retrieve the "flags" for the current customer...

     C*

     C           GCUSNR    CHAINCORCSTEX             37

     C*

     C* If a record was found then update GPRTSM with the value of Flag
#28...
     C*

     C           *IN37     IFEQ *OFF

     C                     MOVEACXFLGS    FLG,1

     C                     MOVE FLG,28    GPRTSM

     C                     ENDIF


Personally I think it's easier to read that you're looking at the 28th flag
using "FLG,28" rather than the SUBST, but it's just my preference.

GPRTSM gets updated with whatever is in FLG(28) - either an "X" or a blank,
so there are no issues about the field not being reinitialised each time.

Hope it helps

Jonathan
-----Original Message-----
From: rpg400-l-bounces+jonathan.mason=astradyne-uk.com@xxxxxxxxxxxx
[mailto:rpg400-l-bounces+jonathan.mason=astradyne-uk.com@xxxxxxxxxxxx] On
Behalf Of Douglas Palme
Sent: 22 February 2007 16:06
To: 'RPG programming on the AS400 / iSeries'
Subject: Minor issue with subst

One of our customer files has a field for customer flags that has a length
of 64.  Each position can be turned on with an X in that position.

 

I am having to modify an old RPG III program that checks this flag position
and I must doing something wrong because I am getting far more records than
I should be.

 

Here is the relevant code and my explanation of what I am doing:

 

C                     MOVE *BLANKS   FLGFLD  1    

C           GCUSNR    CHAINCORCSTEX             37

C           *IN37     IFEQ *OFF                   

C           1         SUBSTCXFLGS:28 FLGFLD       

C           FLGFLD    IFEQ 'X'                    

C                     MOVE 'X'       GPRTSM       

C                     ENDIF                       

C                     ENDIF                       

 

I need to make sure that for each pass through the primary file I am working
with a blank FLGLD (which is just my own internal variable) and only if
CXFLGS position 28 has an 'X' in it do I want to update my work file,
although I do not have a line that moves *blanks to it if not equal I did
not think that would have been necessary.

 

Does anyone see any issue with the code as it is written? 

 



****************************************************************************
This transmission may contain information that is privileged,
Confidential and/or exempt from disclosure under applicable law.
If you are not the intended recipient, you are hereby notified that
any disclosure, copying, distribution, or use of the information
contained herein (including any reliance thereon) is STRICTLY
PROHIBITED. If you received this transmission in error, please
immediately contact the sender and destroy the material in its
entirety, whether in electronic or hard copy format. Thank you.
****************************************************************************

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.