Results 1 to 3 of 3

Thread: Free-form syntax of TEST operation

  1. #1
    Code400 Newbie
    Join Date
    Dec 2004
    Posts
    2
    Rep Power
    0

    Free-form syntax of TEST operation

    Am I the only one who doesn't understand the RPGLE Reference Manual with regard to the free-form syntax of the TEST operation?

    If my traditional syntax looks like this:

    *YMD Test(D E) SLENDT
    If %Error

    then how is that represented in free-form? The reference manual shows the syntax this way:

    TEST{(EDTZ)} {dtz-format} field-name

    I'm not clear on how the concept of factor1, factor2, and result are represented in free-form when there is no BIF. I'm familiar with C, C++, C#, and VB so the free-form built-in functions like the one below make perfect sense to me:

    ISONumeric = %Dec(ISODate : *ISO);

    Anybody?

    Thanks in advance...

  2. # 666
    Circuit advertisement
    Join Date
    Aug 1965
    Posts
    1,000,000
     

  3. #2
    Registered User jimmyoctane's Avatar
    Join Date
    Jan 2004
    Location
    Illinois
    Posts
    210
    Rep Power
    0

    I think your looking for this

    TEST{(EDTZ)} {dtz-format} field-name

    Test with either or combination of "E" "D" "T" or "Z"

    E = error
    D = date
    T = Time
    Z = TimeStamp

    Then The date format in my example *USA (12/14/2004)

    Then the field with the date in it TempDate.

    Code:
    TempDate = %subst(s2NewOvr:1:8);
    test(de) *usa0 TempDate;

    Hope this helps
    Jimmy

  4. #3
    Code400 Newbie
    Join Date
    Dec 2004
    Posts
    2
    Rep Power
    0
    Hi Jimmy,

    It's working now. I had already tried the same line of code with one TINY little difference:

    This works:
    Test(DE) *YMD TestDate;

    This does not:
    Test(D E) *YMD TestDate;

    The space between the D and the E! Traditional syntax will compile either way but free-form won't compile with the space. And here I thought I couldn't interpret the syntax.

    Thanks for your help,
    Paul

  5. # 666
    Circuit advertisement
    Join Date
    Aug 1965
    Posts
    1,000,000
     

Facebook Comments


Similar Threads

  1. Free Form RPG
    By dcutaia in forum /Free format
    Replies: 7
    Last Post: September 28th, 2006, 09:53 AM
  2. Truncate result of aritm. expression - Free form
    By Gianfranco in forum RPG/RPGLE
    Replies: 1
    Last Post: July 8th, 2005, 06:21 AM
  3. Replies: 8
    Last Post: June 17th, 2005, 02:44 PM
  4. How to call a legacy program in Free form
    By EMSS in forum RPG/RPGLE
    Replies: 2
    Last Post: February 2nd, 2005, 12:49 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •