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
the maximum number of subfiles that can be active for a single file is ____ .
how to read database records without locking them?
What Is The Difference Between Goto & Exsr?
what is the sequence when using cursor?
Difference between NOPASS & OMIT?
what is the use of data structures?
what is the purpose of indicators in rpg?
what is the purpose of putovr (put with explicit override) keyword?
how can I give more performance to some selected pages?
what does check opcode do ?
Difference Between Call & Sbmjob?
what is a spool file?
define subsystem?
what is full form for dds?
what are the different methods to access seu?