Hi.can any body give me the code for this quesiton
please.Because i dont have to try to enter the code in to
the AS/400 server.Please can anybody give the answer for
this question with complete code?
A smple RPLE pgm which accepts the starting number and
ending number as parameter.It then has to count all the odd
numbers b/w the accepted range of numbers and display the
results/
Ex:if the input parameters are 11 and 30 the result should
be 10(11,13,15,17,19,21,23,25,27,29)
Please explain and give me the complete code?
Answer Posted / arijit
Please try the below code:
D @StartNum S 3S 0
D @EndNum S 3S 0
D #Counter S 3S 0
D #LoopCnt S 3S 0
D #Result S 50A
*
C *Entry Plist
C Parm @StartNum
C Parm @EndNum
*
C Eval #Result = '('
C Eval #LoopCnt = @StartNum
C Eval #Counter = 0
*
C DoW #LoopCnt < @EndNum
C If %REM(#loopCnt:2) =
1
C Eval #Result = %TRIM(#Result)
+
C %TRIM(%CHAR
(#LoopCnt)) + ','
C Eval #Counter = #Counter +
1
C
ENDIF
*
C Eval #LoopCnt = #LoopCnt +
1
C
EndDo
*
C Eval %SUBST(#Result:%Len(%Trim
(#Result)):1) = ' '
C Eval #Result = %CHAR(#Counter)+%
TRIM(#Result)+')'
*
C #Result
Dsply
C EVAL *InLr =
*On
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
what is xfoot opcode ?
what is the purpose of dynslt keyword?
how to get the cursor position?
What Does 'sr' In Columns 7-8 Of C Specs Mean?
when is a tag statement used in rpg?
in which specification the report layout can be defined?
can you have multiple key lists for a single file ?
how do u compile rpgle program?
can a single screen format occupy a screen area above and below a subfile format ?
difference between sflrcdnbr and sflnxtchg?
how can you detect overflow for a print program that prints multiple lines per cycle?
explain the use of dftwrt display keyword?
what is *iso date format?
maximum number of subfiles that can be active for a single file is?
WHAT IS AS/400 SYNORIO?