Let?s consider a variable X of length 20. Move value ?ABC?
to it.How to determine how many characters does X have?



Let?s consider a variable X of length 20. Move value ?ABC? to it.How to determine how many characte..

Answer / xman

Hello if You Want to Know the Characters In a Variable then
You can Use %Len With %Trim Built-in Functions
Below is the Example

D num1 S 7P 2
D chr1 S 10A inz('Toronto ')

num1 = %len(%trim(chr1));

Value of the Num1 will be 7

Is This Answer Correct ?    14 Yes 0 No

Post New Answer

More RPG400 Interview Questions

I know whole thing ab't Arrays related to declaration..can anyone tell me what exactly use of array or anyone faced a situation where he found use of array must....

1 Answers  


Im traying to get out put of this below mention simple logic code.But im geting out of different.(im trying with my laptop trhough my company server. DCL &FIELD1 *CHAR 10 VALUE('TCS AS/400') DCL &FIELD2 *CHAR 10 CHGVAR(%SST(&FIELD2 1 10))(%SST(&FIELD1 10 1) Can you tell me the value of field2 after excuted of CHGVAR command.

2 Answers  


A rpg or clp command to find if the file field is defined as a character or numeric field.

1 Answers   IBM,


How we will read call stack?

4 Answers  


A particular job executing on the iS is not behaving as expected and is operating in an environment in which it can be debugged. What commands would you use to debug and observe the program?

2 Answers   IBM,






suppose there are 100 records and i want to read records between 60-70 how we can read this 10 records in rpg

2 Answers   Polaris,


what is the equivalent keyword for CHAIN opcode ??

7 Answers   TCS,


When a object will be locked & when a record will be locked? Plz explain.

2 Answers  


can anyone explain aboutovrOVRDBF,OPNQRYF, OVRSCOPE and OPNSCOPE?

2 Answers   TCS,


When PGMA calls PGMB for the first time PGMB executes the *INZSR. PGMB uses the RETRN operation to return to PGMA. When PGMA call PGMB the second time is the *INZSR executed?

5 Answers   Mphasis,


i 'm new to as/400.in an interview i was asked this question.give a practical example for passing information or data through local data area. I know only that data area is an object used to store tiny bits of data or it can store one value at a time and it is used to store frequently changing values or datas.thats all i know about data area can any one tell me how local data area and user defined data area are used to pass data between jobs with a example or coding.thanks in advance.

2 Answers   CTS,


Given the following code, what is the value of RESULT? DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++ D RESULT S 5 0 C EVAL RESULT = (2 + 3 * 2) ** 2 / 2

2 Answers  


Categories