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

How to change the name of physical members Dynamically?

1 Answers  


Hi friends, Can you give the solution for the below mention simple code.and explain.what is output D CHR1 S 4A INZ('PEN') D CHR2 S 10A INZ('MYGET') D CHR3 S 8A INZ('GOOD') D CHR4 S 22A INZ C MOVEL CHR1 CHR4 C MOVE CHR2 CHR4 C EVAL CHR4=CHR3 C MOVE CHR1 CHR4

4 Answers  


Please help me, I have created window subfile,I have created Footer with same lengh and postion of window SFL. When I call the pgm, first is shows only Footer and then it shows subfile records.This time Footer is not showsing ..plz hel me how can i do it...? Sameple DDS and RPG: A R WIN1 SFL A*%%TS SD 20090130 165346 MUNSHIJ REL-V4R2M0 5769- PW1 A FLD001 1Y 0B 4 3EDTCDE (Z) A ATFILE R O 4 7REFFLD (QWHFDBAS/ATFILE LIB/LIBF- A ILE) A R WINCTL SFLCTL (WIN1) A*%%TS SD 20090202 123459 MUNSHIJ REL-V4R2M0 5769- PW1 A ALTNAME ('y') A SFLSIZ (0004) A SFLPAG (0004) A WINDOW (FOOTER) A ROLLUP (27) A ROLLDOWN (28) A CF12 (12 'Cancel') A 50 SFLDSP A N51 SFLDSPCTL A 51 SFLCLR A 1 2'Select Option,Press enter' A 2 3'1= Select' A R FOOTER A* A WINDOW(8 31 9 43) A 8 4'F12 = Cancel' A R DUMMY ASSUME A 24 10' ' in RPG: Dow *IN12 = *Off Write Footer Fxfmt WInCTL

2 Answers  


How do you call procedures in ILE?

3 Answers  


Suppose in CL we reach at end of file and again we have to reach from 1 record

3 Answers   TCS,






What is the Record Address file. How can we use it in RPG program?

4 Answers  


what is batch debug in as400?

3 Answers  


What is Multi Occurrence Data Structure(MODS)?

1 Answers   CTS,


What is the compilation option that has to he specified while compiling an RPC program which uses a file having date data type field?

3 Answers   HSBC, IBM,


How can we make use of SETLL operation in CL?

11 Answers  


there is any limit to display the members in rpg400?

3 Answers  


I want to add 10 days in current date. how it is possible in CL program...?

11 Answers   CSC,


Categories