Can any body give the code for this quesition?
Using the following details write C-Spec code to set Name
to"AMMU LABS SYSTEM"

D NAME1 S 10 INZ('AMMU')
D NAME2 S 10 INZ('LABS')
D NAME3 S 10 INZ('SYSTEM')
D NAME S 20

Answers were Sorted based on User's Feedback



Can any body give the code for this quesition? Using the following details write C-Spec code to set..

Answer / vijay

Minor change in above answer, you have to put %trim.



C EVAL NAME = %trim(NAME1) + ' ' + %trim(NAME2)
+ ' ' + %trim(NAME3)

Is This Answer Correct ?    10 Yes 0 No

Can any body give the code for this quesition? Using the following details write C-Spec code to set..

Answer / sudhir

Vijay is correct.... That field lenghts declared for
variables are not exact as of the initial value assigned.
Hence extra spaces will be added. If the variables are
declared of size exactly as the value, then Syam's code can
be used.

Is This Answer Correct ?    2 Yes 0 No

Can any body give the code for this quesition? Using the following details write C-Spec code to set..

Answer / shriram

syam vijay is right..

Is This Answer Correct ?    0 Yes 0 No

Can any body give the code for this quesition? Using the following details write C-Spec code to set..

Answer / syam

C EVAL NAME = NAME1 + ' ' + NAME2 +
' ' + NAME3

Is This Answer Correct ?    2 Yes 3 No

Can any body give the code for this quesition? Using the following details write C-Spec code to set..

Answer / syam

Hi Vijay.....no need of %trim, no leading or trailing
blanks in name1 or name2 or name3.

%trim is required if ' AMMU' or 'LABS '

Is This Answer Correct ?    0 Yes 5 No

Post New Answer

More RPG400 Interview Questions

i hav 2 logical files(L1,L2) both r derived from one physical file(P1). how can i use both the logical files in one RPG program? if yes what i have to d.

5 Answers   TCS,


How to print output from openquery in as400 ?

1 Answers   Four soft,


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

2 Answers  


how to change the length of the field in a physicalfile?

12 Answers  


1.Load an runtime array of length 99 from the pf and you want to handle all the possible errors?

0 Answers   HCL,






What will happen if we r using seton lr after return or vice versa.

5 Answers  


HI,1: What is the function of 'SETON LR' AND '*INLR=*ON ? 2:Can we used "seton lr" OR "*INLR = *ON" in between the program code ? 3:if yes then according to there function the code which is written acter seton lr/ *inlr should not be execute . Can any one tell me why those code get executed ?

2 Answers  


difference betwen keywords and opcodes

3 Answers  


Difference between creating a report using Printer file and WRKQRY(Query Report) ?

3 Answers  


difference between CHAIN and READE?

8 Answers   HCL,


Can anybody tell me that why we use option(*nodebugio)in H- Spec?

3 Answers  


how to convert date format from one format to another i think in CL/400 its CVTDAT,Please tell in RPG/400 sir not in RPGILE

3 Answers   iGate,


Categories