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


  • Subject: Re: Edit codes - API code sample
  • From: Buck Calabro/commsoft<mcalabro@xxxxxxxxxxxx>
  • Date: Fri, 26 Mar 1999 12:14:07 -0500

On 03/26/99 10:43:21 AM "Scott Swaim"  wrote:

>This field is then moved to a Screen field that is Alpahnumber (75 
length).
>What I need to know is how do I put an edit code on the above numeric 
field?

If you are using a recent release, look at the %editc and %editw built in 
functions.  If you are on an older release, look at the QECCVTEC and QECEDT 
APIs.  Here's an RPG400 snippet:

I* Convert edit code parms 
I           IDS 
I                                        1 256 CMASK 
I                                    B 257 2600CMLEN 
I                                    B 261 2640CRLEN 
I                                      265 265 CZFILL 
I                                      266 266 CCODE 
I                                      267 267 CFILL 
I                                    B 268 2710CPREC 
I                                    B 272 2750CDEC 
I                                      276 372 CERROR 
I* Edit parms 
I           IDS 
I                                        1  24 EOUTPT 
I                                    B  25  280ERLEN 
I                                       29  402EINPUT 
I                                       41  50 EINTYP 
I                                    B  51  540EPREC 
I                                       55 310 EMASK 
I                                    B 311 3140EMLEN 
I                                      315 315 EZFILL 
I                                      316 409 EERROR 
I* Exception/error format 
IERRFMT     IDS 
I                                    B   1   40ERPRO 
I                                    B   5   80ERAVL 
I                                        9  15 ERID 
I                                       16  96 ERDTA 
C* Convert edit code to mask 
C                     MOVE *BLANKS   CMASK     P 
C                     MOVE 'P'       CCODE 
C                     MOVE *BLANKS   CFILL 
C                     Z-ADD12        CPREC 
C                     Z-ADD2         CDEC 
C                     CALL 'QECCVTEC' 
C                     PARM           CMASK 
C                     PARM           CMLEN 
C                     PARM           CRLEN 
C                     PARM           CZFILL 
C                     PARM           CCODE 
C                     PARM           CFILL 
C                     PARM           CPREC 
C                     PARM           CDEC 
C                     PARM           CERROR 
C                     MOVE CERROR    ERRFMT 
C* Edit input variable 
C                     MOVE *BLANKS   EOUTPT 
C                     Z-ADDCRLEN     ERLEN 
C                     Z-ADD-123456.78EINPUT 
C                     MOVEL'*ZONED'  EINTYP 
C                     Z-ADDCPREC     EPREC 
C                     MOVELCMASK     EMASK     P 
C                     Z-ADDCMLEN     EMLEN 
C                     MOVELCZFILL    EZFILL 
C                     CALL 'QECEDT' 
C                     PARM           EOUTPT 
C                     PARM           ERLEN 
C                     PARM           EINPUT 
C                     PARM           EINTYP 
C                     PARM           EPREC 
C                     PARM           EMASK 
C                     PARM           EMLEN 
C                     PARM           EZFILL 
C                     PARM           EERROR 
C                     MOVE EERROR    ERRFMT 
C* Extract output and return 
C* my particular situation has 12/2 input, so I need 14 output 
C                     MOVELEOUTPT    CHAR14 14 
C                     SETON                     LR 

Hope this helps.

By the way, if anybody would rather that I stopped posting code, please let 
me know.  I do not want to become even more annoying :-)  Also, critiques 
encouraged!  I'll never learn if somebody doesn't correct me...

Buck Calabro
Billing Concepts Inc (formerly CommSoft), Albany, NY
mailto:mcalabro@commsoft.net
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


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.