disply emp details on the screen

10 pts.
Tags:
AS/400
CL
DSPF
SDA
Hi , can any one of you share with me a sample code of a cl when a user enters a the employee ID on the screen read the emp table and display the employee details on the screen.

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi,

Tough to do this as we don’t know the fields in this ‘emp table’. So this code is based on a dump of the user profiles to an outfile.
I will also assume that the employee ID entered is the same as the UID on the profile.
If the EMP table simply consists of the employee ID and the person’s name (not the iseries profile) then more work is needed.

This also works off a command that is easy to create and place on a menu.

*************** Beginning of data ************************************
CMD PROMPT(‘DISPLAY PROFILE’)
PARM KWD(INPUTID) TYPE(*DEC) LEN(10) MIN(1) +
CHOICE(NAME) PROMPT(‘Employee ID’)

Program Code:
PGM PARM(&INPUTID)

DCLF FILE(*LIBL/USRPRF)
DCL VAR(&INPUTID) TYPE(*DEC) LEN(10 0)

/* READ EMP TABLE FILE */
READ: RCVF
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(MSG))

/* CHECK FOR MATCHING RECORD */
IF COND(&INPUTID *EQ &UPUID) THEN(DO)
DSPUSRPRF USRPRF(&UPUPRF)
GOTO CMDLBL(END)
ENDDO
GOTO CMDLBL(READ)

/* SEND MESSAGE IF PROFILE IS NOT FOUND */
MSG: SNDPGMMSG MSG(‘Profile not found. Please input a +
valid employee ID’)

END: ENDPGM

Hope this helps
Barry

Discuss This Question: 1  Reply

 
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
  • TomLiotta
    We also don't know if the need is to display the user profile object itself or to display the "details" from the "emp table" which would be very different. Nor do we know what environment this will run under -- V5R2? V5R3? V5R4? V6R1? something else? Since this is tagged with "SDA", is there a display file that should be used? Tom
    125,585 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