1.Are there any errors in the following statement?If so
then list them.DTAARA is a data area having a field EMP #
and EMPNO is a
field in the file EMPPF.Which has one record.
READ EMPPF
IF %FOUND(EMPPF)
IN DTAARA
EVAL EMP#=EMPNO
OUT DTAARA
ENDIF
Answers were Sorted based on User's Feedback
Answer / amitava
First of all, %found() function is not set after the READ
operation. If not %eof() can be used instead.
Is This Answer Correct ? | 8 Yes | 3 No |
Answer / abhishek
I think before updating data area it should be Locked too
to make sure no other program is trying to update same data
area.
READ EMPPF
IF %FOUND(EMPPF)
*LOCK IN DTAARA
EVAL EMP#=EMPNO
OUT DTAARA
ENDIF
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / abhishek
Sorry forgot to put * before data area.
READ EMPPF
IF %FOUND(EMPPF)
*LOCK IN *DTAARA
EVAL EMP#=EMPNO
OUT *DTAARA
ENDIF
Is This Answer Correct ? | 0 Yes | 2 No |
HOW DO YOU DISPLAY A DISPLAYFILE AT OTHER WORKSTATION? CAN WE MOVE A PHYSICAL FILE? WITHOUT MOVING A FILE?
I need to generate outfile for object of all the user lib. in the sysmte using cmd DSPOBJD. But this cmd is correcpted in my server,Any body tell me is there any alternative...?
Are all these RPG/400 Interviewed Questions being asked recently? are current?
Suppose we have 10 records with same name and we are reading using READE,after 4 record i have to use CHAIN what is the output
1.what are the ARITHMETIC EXPRESSIONS IN CL PGM? 2.How to PASSING PARAMETER TO CL PGM?
what is file information data structure?
what is plat file?
Suppose i am having 3 programs PgmA,pgmB,pgmC and using source debugger. At debugging time i found that pgmC having some code error..then in debug mode directly how can i debug pgmC
How to create a key field for a logical file inside RPG?
How do I read records from Subfile? what is the purpose of READC explain with example?
how do u find whether a record is locked or not??/
3. Given the DOS Specification below and the following information: • Indicator 50 is off • No records have been written to the subfile What will be the result if the EXFMT operation code is performed on the record format CTLR? A R SUBFL A DESCRIP 101 6 1ODSPATR(UL) A DFT(’NOT FOUND’) A R CTLR SFLCTL(SUBFL) A N50 SFLDSP A SFLDSPCTL A SFLINZ A 67 SFIJEND A SFLSIZ(13) A SFLPAG(12) A ACCOUNTNO 100 S 10 a.) Only AccountNo will display b.) SUBFL will be initialized with 13 blank records c.) An I/O exception error will occur d.) The screen will display 12 records with ‘NOT FOUND’