Hi,

You can get such a string by the API like below. Sorry, this is an OPM
example.Of course you can do it by the ILE.

     H        1   Y/                                    1
     I            DS
     I I            0                     B   1   40MSKLEN
     I I            0                     B   5   80RCVLEN
     I I            0                     B   9  120INTLEN
     I I            0                     B  13  160PNTLEN
     IERROR       DS
     I I            0                     B   1   40BYTPRV
     I I            0                     B   5   80BYTAVA
     I                                        9  15 ERRID
     I                                       16  16 ERR###
     I                                       17 272 INSDTA
     C******************************************************
     C*             M A I N -  R O U T I N E                
     C******************************************************
     C                     CALL 'QECCVTEC'                 :
     C                     PARM           MASK  256        :
     C                     PARM           MSKLEN           :
     C                     PARM           RCVLEN           :
     C                     PARM ' '       ZEROSP  1        ;
     C                     PARM 'J'       EDITCD  1        ;<=edit code
     C                     PARM ' '       SYMBOL  1        :
     C                     PARM 15        INTLEN           :
     C                     PARM 0         PNTLEN           :
     C                     PARM           ERROR            :
     C*                                                    ;
     C                     Z-ADD-1500000  WRK    150
     C*                                                    ;
     C                     MOVE *ZERO     EDIT             ;
     C                     MOVE WRK       EDIT             ;
     C                     CALL 'QECEDT'                   :
     C                     PARM           EDITED256        ;
     C                     PARM           RCVLEN           ;
     C                     PARM           EDIT   15        ;<==
     C                     PARM '*ZONED'  EDTCLS 10        ;
     C                     PARM 15        INTLEN           ;
     C                     PARM           MASK             ;
     C                     PARM           MSKLEN           ;
     C                     PARM           ZEROSP           ;
     C                     PARM           ERROR            :
     C*                                                    ;
     C                     MOVE *ON       *INLR            ;
     C                     RETRN                           ;

After you call the QECEDT, character field EDIT has 1,500,000- . (Would
you check it by the debager?)

And you better check the ERROR after you call the APIs. I didn't do it
in the example above.

Hope this help.

On Fri, 5 Nov 1999 10:01:55 -0600 
Lurton Keel <Lurton.Keel@serx.com> wrote as :

   > I have a little RPG challenge.
   > I get an 8 character string that has a number that may or may not have a
   > decimal position.
   > Examples: 12345.78 or 123 or 1.23456, etc.
   > I need to convert this to a number (10,5).
   > The way it was done in RPG prior was to move to an array and scan for the
   > decimal, do a bunch of move, movels.
   > 
   > Is there a more elegant way to do this in ILE?
   > 
   > 
   > +---
   > | This is the RPG/400 Mailing List!
   > | To submit a new message, send your mail to RPG400-L@midrange.com.
   > | To subscribe to this list send email to RPG400-L-SUB@midrange.com.
   > | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
   > | Questions should be directed to the list owner/operator: 
david@midrange.com
   > +---
   > 

/* ---------------------------------------------------------*/
                       Tadashi Kakefuda
The Internet Mail Address ; tadashii@tk.airnet.ne.jp
   * Official site ; http://www2c.airnet.ne.jp/as400/
   * Private site ; http://www2c.airnet.ne.jp/as400/private/    
/*----------------------------------------------------------*/
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-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 ...

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.