question on eval - IBM AS400

This is a discussion on question on eval - IBM AS400 ; I have a 3-digit number I want to use in a file name I am creating in an eval statement. For instance: eval filename = /folder/test + trim(splid) + '_' + char(num) + '_' Is there a way I can ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: question on eval

  1. question on eval

    I have a 3-digit number I want to use in a file name I am creating in
    an eval statement.

    For instance:

    eval filename = /folder/test
    + trim(splid) + '_'
    + char(num) + '_'

    Is there a way I can make sure all 3 digits of the number get
    included?? Right now when I do this all I am getting is the numbers,
    no leading zeroes. I want to have the leading zeroes included. Is
    that possible?

    Do I have to use something other than "char(num)" for that to work? I
    assume i have to use "char(num) because it's character data for the
    fle name, but I'd like to get that leading zero if possible.

    thanks,
    ga

    ga
    nospam@nospam.fmctc.com

  2. Re: question on eval

    il 21/01/2008 17.32, Scrive ga 39344272:
    > I have a 3-digit number I want to use in a file name I am creating in
    > an eval statement.
    >
    > For instance:
    >
    > eval filename = /folder/test
    > + trim(splid) + '_'
    > + char(num) + '_'
    >
    > Is there a way I can make sure all 3 digits of the number get
    > included?? Right now when I do this all I am getting is the numbers,
    > no leading zeroes. I want to have the leading zeroes included. Is
    > that possible?

    Try this:
    eval filename = '/folder/test'
    + %trim(splid) + '_'
    + %editc(num:'X') + '_'


    --
    Dr.Ugo Gagliardelli,Modena,ItalyCertifiedUindoscrasherAñe joAlcoolInside
    Spaccamaroni andate a cagare/Spammers not welcome/Spammers vão à merda
    Spamers iros a la mierda/Spamers allez vous faire foutre/Spammers loop
    schijten/Spammers macht Euch vom Acker/Spamerzy wypierdalac'

  3. Re: question on eval

    THANK YOU. Worked great. Where is a good place to get more info on
    eval, using %trim, %editc, etc??

    thanks,

    "Dr.UgoGagliardelli" wrote:

    >il 21/01/2008 17.32, Scrive ga 39344272:
    >> I have a 3-digit number I want to use in a file name I am creating in
    >> an eval statement.
    >>
    >> For instance:
    >>
    >> eval filename = /folder/test
    >> + trim(splid) + '_'
    >> + char(num) + '_'
    >>
    >> Is there a way I can make sure all 3 digits of the number get
    >> included?? Right now when I do this all I am getting is the numbers,
    >> no leading zeroes. I want to have the leading zeroes included. Is
    >> that possible?

    >Try this:
    >eval filename = '/folder/test'
    > + %trim(splid) + '_'
    > + %editc(num:'X') + '_'


    ga
    nospam@nospam.fmctc.com

  4. Re: question on eval

    il 21/01/2008 18.04, Scrive ga 39344272:
    > THANK YOU. Worked great. Where is a good place to get more info on
    > eval, using %trim, %editc, etc??

    I cannot think any other place but the RPG Reference (or this ng!)
    Try iSeries information center at http://publib.boulder.ibm.com/iseries/
    in programming section you'll find rpg manuals both online and for
    download in pdf format, e.g. for ile rpg v5r3 the full link is
    http://publib.boulder.ibm.com/infoce...s/sc092508.pdf
    while the main rpg page is
    http://publib.boulder.ibm.com/infoce...ahgrpgcode.htm
    --
    Dr.Ugo Gagliardelli,Modena,ItalyCertifiedUindoscrasherAñe joAlcoolInside
    Spaccamaroni andate a cagare/Spammers not welcome/Spammers vão à merda
    Spamers iros a la mierda/Spamers allez vous faire foutre/Spammers loop
    schijten/Spammers macht Euch vom Acker/Spamerzy wypierdalac'

  5. Re: question on eval

    On Jan 21, 12:04*pm, ga wrote:
    > THANK YOU. *Worked great. *Where is a good place to get more info on
    > eval, using %trim, %editc, etc??
    >


    If you are using the LPEX editor instead of the old SEU, you can just
    type %trim and press F1 to be taken to the page in the RPG manual that
    describes this BIF. If you hit Ctrl-Space instead, it will give you
    the fill-in prompts (kind of like the Java editors).

  6. Re: question on eval

    THANKS!


    Graybeard wrote:

    >On Jan 21, 12:04*pm, ga wrote:
    >> THANK YOU. *Worked great. *Where is a good place to get more info on
    >> eval, using %trim, %editc, etc??
    >>

    >
    >If you are using the LPEX editor instead of the old SEU, you can just
    >type %trim and press F1 to be taken to the page in the RPG manual that
    >describes this BIF. If you hit Ctrl-Space instead, it will give you
    >the fill-in prompts (kind of like the Java editors).


    ga
    nospam@nospam.fmctc.com

+ Reply to Thread