Write a program to display prime numbers between 1 to 100 using RPGLE.
D N S 2P 0 INZ 0
D Q S 2P 0
D R S 2P 0
D I S 2P 0
C PARM N
MOVE 2 I
DOU I >= N
I DIV N Q
MVR R
IF R=0
“Number is not PRIME” DSPLY
ENDIF
ADD 1 I
ENDDO
IF N=I
THEN
“Number is PRIME” DSPLY
ENDIF
C SETON LR
| Is This Answer Correct ? | 3 Yes | 2 No |
What are different ways to pass data between programs and which one is the efficient way?
How do I read records from Subfile? what is the purpose of READC explain with example?
1.Write code to read the records from a file and load an array of size 99? Make sure that you take care of all the error conditions?
suppose i i am changing / updating record of subfile and i want to change the record in reverse order . means i want to change the bottom record first and so on through readc . how i do it please any one explain .
How Chain operation copies the record's data to the input buffer for the program?
Some times While checking MSGW for object / member / record locks ,I have seen it's locked by itself ...? How it happen and what action we need to perform if job is updating / writing a record....?
do you use message subfiles? What are the necessary keywords required coding a message subfile?
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.
how do I preserve and clean the array?
what is data area and how it is used in rpg program ?
1.Can any body share me about thease opcodes with example please.Im new for AS/400.Could u please tell me in real senario? 1.TESTN, 2.EVAL 3.EVALR, TIME, 4.MONITOR 5. ENDMON 6.ON-ERROR 7.COMMIT ROLLBACK?
Can more than one subfile record be displayed on one line?