How to retrive USRPRF name in RPGLE

2475 pts.
Tags:
AS/400
RPGLE
USRPRF
Hi, As I'm aware there are two ways to retrieve the User Profile Name in the RPGLE. One is using Data Area Data Structure, like
LOCALDA          U DS
usrID                   1    10
then,
*DTAARA       Define    *LDA          PROGRAM
Movel     usrID         ID               10
Another way from Program Status Data Structure, like
PrgDS          sds
usrID                 254    263
Which one would be better when multiple users accessing the program in the same time? Surey.

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • philpl1jb

    The program data structure gets the name from the system.  It will always have the name. 

    The local data area is attached to your job stream.  It is initially blank until/unless your application programs put a value into it. Your code seems to move the value from the first 10 characters of the LDA to your field ID.  So some program upstream must populate the LDA with the user id.

    51,355 pointsBadges:
    report
  • WoodEngineer
    Go with the SDS method.  No need to write any special code to populate the LDA.  
    6,875 pointsBadges:
    report
  • bvining
    I'll just point out that there are actually two user profile name elements in the PSDS. The one at 254-263 is the user profile used as part of the job name and has a fixed value. The one at 358-367 is the user profile the job is currently running under and can vary depending on how the job is coded. In many cases they are the same but they can be different if the job supports swapping of user profiles.
    6,620 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following