1.WHAT IS WRONG WITH THE CODE BELOW?
C CUSTNO CHAIN CUSTMAST
IF %ERROR

can any body find the wrong please?

2.What builtin function will you use to achieve the
following functionality?
C QTY IFLT *ZERO
C QTY MULT-1 QTY
ENDIF

Answers were Sorted based on User's Feedback



1.WHAT IS WRONG WITH THE CODE BELOW? C CUSTNO CHAIN CUSTMAST ..

Answer / ajit

C CUSTNO CHAIN CUSTMAST
IF %ERROR

1) The position is incorrect.
2) If you mistakenly wrote incorrect position, then for %ERROR, you should use CHAIN(E).
3) Use EVAL %ABS(Name of the variable) for 2nd Q.

Is This Answer Correct ?    7 Yes 1 No

1.WHAT IS WRONG WITH THE CODE BELOW? C CUSTNO CHAIN CUSTMAST ..

Answer / jaijo

1. CHAIN(E)has to be used and not chain.

2. %abs

Is This Answer Correct ?    5 Yes 1 No

1.WHAT IS WRONG WITH THE CODE BELOW? C CUSTNO CHAIN CUSTMAST ..

Answer / ved dubey

1. The Position of opcode if is not valid...
2. %ABS can be used instead of this code

Is This Answer Correct ?    3 Yes 1 No

1.WHAT IS WRONG WITH THE CODE BELOW? C CUSTNO CHAIN CUSTMAST ..

Answer / naveen chandra joshi

%error should nto be user with Chain opcode. %Found()/% Not
Found() is used with Chain opcode.

Is This Answer Correct ?    4 Yes 2 No

1.WHAT IS WRONG WITH THE CODE BELOW? C CUSTNO CHAIN CUSTMAST ..

Answer / syam

A1. C CUSTNO CHAIN(E) CUSTMAST
A2. QTY = %ABS(QTY * -1)

Is This Answer Correct ?    2 Yes 6 No

Post New Answer

More RPG400 Interview Questions

check existence of one record without using chain or read?

1 Answers   IBM,


Assume 2 users are using the same file and first user updates some record in the file. Will the 2nd user will be able to see the updated record or not?

0 Answers  


Hi guys, anybody know How RPG/400 code can be converted to RPG IV code with a single command?

1 Answers  


how can i retrieve the field name from display file at run time? Devendra Singh Tomar

3 Answers  


what is commitment control?explain about it?

1 Answers   HSBC,


how to check on which PF , the LF is dependant ?

4 Answers   IBM,


How can we find out whether the job is interactive or Batch through RPG program? 2) How can we find out through CL program?

6 Answers   CSC,


This is my Physical file 'EMPS' existing in library "TAMIL1" and its record format is 'EMPRCD" a)its source is R EMPRCD ENO 4 0 ENAME 10 EADD 10 b)The records present in EMPS are as follows ENO ENAME EADD 0001 tamil coimbatore 0002 kumar bangalore 0003 sunder bangalore 0004 arunkumar chennai 0005 pandi hyderabad 0006 santhosh hyderabad 0007 sasi salem 0008 kalai chennai 0009 suresh hyderabad 0010 vijay bangalore 0011 Arul chennai 0012 velu chennai 0013 khan bangalore 0014 praba chennai 0015 praba.p coimbatore 0016 anand ooty 0017 raja erode 0018 sankar erode 0019 vadivel namakkal 0020 anbu chennai 0021 Ajith mumabi c)now i want to select the 'ENAME' field records starting with 'S' for that i have created a RPG program its source code is PGM DCLF FILE(TAMIL1/EMPS) DCL VAR(&MYENO) TYPE(*CHAR) LEN(4) OVRDBF FILE(EMPS) SHARE(*YES) OPNQRYF FILE((TAMIL1/EMPS)) QRYSLT('ENAME *EQ %WLDCRD("S *")') READ: RCVF RCDFMT(EMPRCD) MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(END)) CHGVAR VAR(&MYENO) VALUE(&ENO) SNDUSRMSG MSG(&MYENO) SNDUSRMSG MSG(&ENAME) SNDUSRMSG MSG(&EADD) GOTO READ END: CLOF OPNID(EMPS) DLTOVR FILE(EMPS) ENDPGM Is this coding correct sir,the program gets compiled,and if i call it it says query running but records are not displayed.please help me out

4 Answers   Virtusa,


How to find d key field of a pf that doesn’t have source physical file?

2 Answers  


How many program bind in one module....

0 Answers  


what is difference between DSPFD and DSPFFD?please give me real senario with good example?

1 Answers  


what is the necessary command needed before OPNQRYF and why?

5 Answers  


Categories