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
define the purpose of the iter operation?
what is the clp command to access a query/400?
what is message file?
How do you check object lock
when are the unique constraints executed?
what is a spool file?
what is the purpose of putovr (put with explicit override) keyword?
What Does 'sr' In Columns 7-8 Of C Specs Mean?
what is the maximum number of records you can specify in a display file?
define what a data queue is along with a brief example of what it may be used for?
what do we can do with the embedded sql statements?
What Is The Difference Between Goto & Exsr?
how can I control the way a remote browser uses its cache?
Pose, there are 100 records in the file.i need to retrieve all the records matching/equal to the particular name field. How can we do the above using search criteria other than using the if cond?
records can be read/update/deleted with which file?