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

Can AnyOne tell me how to read join logical file in rpg from starting to end?

2 Answers  


what will happen two jobs have same name are submitted

5 Answers   CTS,


How can we read a particular record from the database file which is not having DDS (Flat File). For example, there are 100 records in the flat file. How can we retrive 15th record in RPG/400 program (Without using CL)

6 Answers   CTS, IBM,


WHERE DO WE USE COMIT KEYWORD IN AN RPG PROGRAM? YOU MADE SOME CHANGES TO DATABASE BUT YOU DON'T WANT TO SAVE THOSE CHANGES NOW? HOW DO YOU HANDLE THIS ONE?

2 Answers  


Can you copy the records created by the OPNQRYF to other files and how?

2 Answers  






i want to perform uniqness on db file bt my db file nt hving key by useing rpgle.

3 Answers   HSBC,


How to print output from openquery in as400 ?

1 Answers   Four soft,


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...?

2 Answers  


wat is the difference between array and multiple occurence data structure?

4 Answers   Four soft,


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

1 Answers  


suppose i i am changing / updating record of subfile and i want to change the record in reverse order . means i want to change the bottom record first and so on through readc . how i do it please any one explain .

4 Answers   CSC,


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  


Categories