10 pts.
 disply emp details on the screen
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.

Software/Hardware used:
ASKED: April 9, 2010  9:54 AM
UPDATED: April 9, 2010  11:25 PM

Answer Wiki:
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
Last Wiki Answer Submitted:  April 9, 2010  5:39 pm  by  Bggas400   160 pts.
All Answer Wiki Contributors:  Bggas400   160 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

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

 110,165 pts.