IBMiAccess




Results 1 to 13 of 13

Thread: XLATE opcode in RPG

  1. #1
    Code400 Newbie
    Join Date
    Mar 2010
    Location
    India
    Posts
    11
    Rep Power
    0

    XLATE opcode in RPG

    Code:
    D Up              C                   'ABCDEFGHIJKLMNOPQRS-
    D                                        'TUVWXYZ'
    D Lo              C                   'abcdefghijklmnopqrs-
                                               'tuvwxyz'
    C                   MOVE             'rpg dept'    String            8
    C     Lo:Up     XLATE            String        Result
    What will be the value of Result??
    and Why??

    regards,
    SWARUP
    Last edited by tomholden; March 15th, 2010 at 08:30 AM. Reason: added code tags...apparently google and code tags aren't familiar to some folks...

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

  3. #2
    Analyst
    Join Date
    Sep 2005
    Location
    Germany
    Posts
    1,607
    Rep Power
    9607

    Re: XLATE opcode in RPG

    Just enter the snippet into a source file, compile it and debug it (or display the result by using the OPCode DSPLY).

    For more information have a look into the RPG Reference:
    XLATE (Translate)

    The example you posted is even an example out of the RPG Reference!!!!


    Birgitta

  4. #3
    Code400 Newbie
    Join Date
    Mar 2010
    Location
    India
    Posts
    11
    Rep Power
    0

    Re: XLATE opcode in RPG

    Quote Originally Posted by B.Hauser View Post
    Just enter the snippet into a source file, compile it and debug it (or display the result by using the OPCode DSPLY).

    For more information have a look into the RPG Reference:
    XLATE (Translate)

    The example you posted is even an example out of the RPG Reference!!!!


    Birgitta
    The value of Result will be 'RPG DEPT',
    but why is't so??
    in translate operation I have given LO:UP .
    what's the meaning of the separator between LO and UP i.e. `:`
    and how it works??
    that I still really couldn't understand ?

    regards,
    SWARUP

  5. #4
    Harbinger of Doom tomholden's Avatar
    Join Date
    Dec 2007
    Location
    Lebanon, Tennessee, United States
    Posts
    4,341
    Rep Power
    8668

    Re: XLATE opcode in RPG

    if you can't understand the VERY simple instructions, graph etc shown in that VERY simple example then perhaps you should consider a class in reading comprehension as well as the RPG course you are currently failing..
    I'm not anti-social, I just don't like people -Tommy Holden

  6. #5
    ibm-i-a-holic NickLitten's Avatar
    Join Date
    Feb 2009
    Location
    Charleston, South Carolina, United States
    Posts
    139
    Rep Power
    680

    Re: XLATE opcode in RPG

    we all had to start some where....

    1 - XLATE is the operation code which means - translate
    2 - factor 1 (lo:up) is the input for the operation ie: take the LO characters and translate them to UP characters
    3 - factor 2 (string) is the field that is being translated
    4 - result (result) is the result of the operation

    Most importantly, unless you have flame proof underwear, always remember to http://lmgtfy.com/?q=rpg+xlate

    predictably positive, permanently punctilious, purposely proactive, potentially priceless, primarily professional : projex

  7. #6
    ibm-i-a-holic NickLitten's Avatar
    Join Date
    Feb 2009
    Location
    Charleston, South Carolina, United States
    Posts
    139
    Rep Power
    680

    Re: XLATE opcode in RPG

    ...and for Thors sake dont ask what move does!

    /me crawls back into his cubicle talking to himself, twitching and swatting imaginary insects
    predictably positive, permanently punctilious, purposely proactive, potentially priceless, primarily professional : projex

  8. #7
    Harbinger of Doom tomholden's Avatar
    Join Date
    Dec 2007
    Location
    Lebanon, Tennessee, United States
    Posts
    4,341
    Rep Power
    8668

    Re: XLATE opcode in RPG

    Quote Originally Posted by Finkpad View Post
    we all had to start some where....
    and that somewhere was generally to RTFM...and in today's world it's even easier with Google, Bing, , etc. maybe it's just me but in the time it takes to post the question here they could have tons of relevant information about these RPG 101 questions, so why not take those few seconds? and in this case the OP actually found the code IN the RPG reference manual fer crying out loud. i went to the link Birgitta posted and the opcode syntax, usage, etc are spelled out in 1st grade equivalent language!
    I'm not anti-social, I just don't like people -Tommy Holden

  9. #8
    ibm-i-a-holic NickLitten's Avatar
    Join Date
    Feb 2009
    Location
    Charleston, South Carolina, United States
    Posts
    139
    Rep Power
    680

    Re: XLATE opcode in RPG

    aaannnnnndddd..... breathe.....

    predictably positive, permanently punctilious, purposely proactive, potentially priceless, primarily professional : projex

  10. #9
    Code400 Newbie
    Join Date
    Mar 2010
    Location
    India
    Posts
    11
    Rep Power
    0

    Re: XLATE opcode in RPG

    Quote Originally Posted by Finkpad View Post
    we all had to start some where....

    1 - XLATE is the operation code which means - translate
    2 - factor 1 (lo:up) is the input for the operation ie: take the LO characters and translate them to UP characters
    3 - factor 2 (string) is the field that is being translated
    4 - result (result) is the result of the operation

    Most importantly, unless you have flame proof underwear, always remember to http://lmgtfy.com/?q=rpg+xlate

    D ABC C 'SNGRATE'
    D XYZ C 'SRBPEU@`
    C MOVE 'STRANGE' String 7
    C ABC:XYZ XLATE String Result

    so is Result will contain 'SUPERB@` after XLATE...????

    sorry for asking very very simple question,but anyway Im too new for it, only for 7days Iv seen AS400.

    thanks for answering, and always will except the answer from you all.

    regards,
    SWARUP

  11. #10
    ibm-i-a-holic NickLitten's Avatar
    Join Date
    Feb 2009
    Location
    Charleston, South Carolina, United States
    Posts
    139
    Rep Power
    680

    Re: XLATE opcode in RPG

    Correct!

    Heres a very simple way of testing the code example:

    Code:
    D ABC             C                   'SNGRATE'                   
    D XYZ             C                   'SRBPEU@'                   
    C                   MOVE      'STRANGE'     String            7   
    C     ABC:XYZ       XLATE     String        Result            7   
     * display the value of field 'RESULT' to the screen              
    C     RESULT        DSPLY                                         
     * end this silly little thing                                    
    C                   eval      *inlr = *on
    predictably positive, permanently punctilious, purposely proactive, potentially priceless, primarily professional : projex

  12. #11
    IBM Midrange Veteran Poddys's Avatar
    Join Date
    Jun 2011
    Location
    Southampton
    Posts
    109
    Rep Power
    368

    Re: XLATE opcode in RPG

    In the "old days" (god that makes me feel old) all we had was the manuals and our peers.
    Seems these days newbies either don't have peers to turn to, or are scared to ask questions.
    Either way it's (a) scary for the future of computing and (b) job security for us.

    Makes me wonder how many are mis-interpreting the Yoda Jedi Manual.

    When Yoda said "there is no try" he meant do not try, but do and succeed.

    Seems some people are assuming this to mean do not try - get someone else to do it instead.

    I love Finkpad's comment...
    /me crawls back into his cubicle talking to himself, twitching and swatting imaginary insects

  13. #12
    Experienced Forum Member
    Join Date
    Jun 2010
    Location
    RI
    Posts
    186
    Rep Power
    1049

    Re: XLATE opcode in RPG

    We we first started to learn this stuff, all the materials and the teachers were in a language and culture we knew. Other than those individuals looking for test answers or trying to get someone to do there work for them. I wouldn't be surprised if there is a language and or culture issues going on that causes confusion on some of those trying to ask legit questions.

  14. #13
    IBM Midrange Veteran Poddys's Avatar
    Join Date
    Jun 2011
    Location
    Southampton
    Posts
    109
    Rep Power
    368

    Re: XLATE opcode in RPG

    Quote Originally Posted by DAG0000 View Post
    We we first started to learn this stuff, all the materials and the teachers were in a language and culture we knew. Other than those individuals looking for test answers or trying to get someone to do there work for them. I wouldn't be surprised if there is a language and or culture issues going on that causes confusion on some of those trying to ask legit questions.
    You could be right. We were always taught to ask questions if we weren't sure, and from the number of posts on AS400 forums in the last 3-4 years from newbies, it seems like that is not happening. It's like they are expected to find out for themselves, whereas a combination of reading the manuals and seeking knowledge from your peers always worked in the past.

    I read the manuals to gleam everything that I can, always did, still do, but there is no substitute for asking someone knowledgeable. It always used to be within your same company/dept.

  15. # 666
    Circuit advertisement
    Join Date
    Aug 1965
    Location
    Yakutsk, Russia
    Posts
    1,000,000
     

Facebook Comments


Similar Threads

  1. POST opcode
    By sai400 in forum RPG/RPGLE
    Replies: 4
    Last Post: February 18th, 2008, 09:00 AM
  2. Except opcode
    By sai400 in forum RPG/RPGLE
    Replies: 2
    Last Post: November 1st, 2007, 08:32 AM
  3. Reg : %XLATE
    By kmkmagesh in forum RPG/RPGLE
    Replies: 2
    Last Post: July 6th, 2006, 05:26 AM
  4. %xlate - example
    By jamief in forum /Free format
    Replies: 0
    Last Post: December 28th, 2005, 12:25 PM
  5. Date opcode
    By mksamy_99 in forum RPG/RPGLE
    Replies: 2
    Last Post: September 2nd, 2005, 08:38 AM

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
  •