1)how to do date validation in rpg?
2)how to delete dUPLICATE RECORDS?
Answers were Sorted based on User's Feedback
Answer / anonymus
TO VALIDATE DATE IN RPG .GO FOR "TEST" OPCODE
TO DELETE DUPLICATE RECORDS IN RPG GO FOR READE &DELETE
|Is This Answer Correct ?||13 Yes||6 No|
Answer / madhusudhan
1. Date Validation you can do with TESTD
2. Duplicate Records. There are two ways to delete this
a. Through SQL, after selecting the RRN numbers, you can
use the delete statement in SQL to delete the unwanted
record based on the RRN
b. Through RPG, but if you use the SETLL and READE, all
the records along with the duplicates will get deleted , so
you need to use one variable for count, once it reaches 1 ,
stop doing the delete.
|Is This Answer Correct ?||5 Yes||0 No|
Answer / riyaz
Hi Sumathi, How can u delete duplicate records using RRN?
|Is This Answer Correct ?||4 Yes||1 No|
Answer / swetha p rao
TEST works in RPG400 not in RPG.
|Is This Answer Correct ?||3 Yes||2 No|
Answer / raghav
2. Delete from File1 F1 where RRN(f1) > (select MIN(RRN(F2)) from File1 F2 where F2.Field1 = F1.Field1)
|Is This Answer Correct ?||1 Yes||0 No|
Answer / chandu
We can delete duplicate records by using this:
factor1 opcode factor2 result eq
key setll pf
reade pf 50
reade pf 50
|Is This Answer Correct ?||4 Yes||4 No|
Answer / zhang
Hi Riyaz, Sorry I'm not Sumathi,
I guess maybe we can use SQL to do that.
Select RRN(tableA) from tableA ;
Delete from tableA where RRN(tableA) =? ;
|Is This Answer Correct ?||4 Yes||6 No|
1: FOR DATE VALIDATION
TESTD(E) *ISO(WHAT EVER) DATE VARIABLE ;
IF %ERROR ;
DO SOME THING ;
2: CREATE A LOGICAL ON THAT FILE WITH KEY SAY FILE1
FFILE1 IP E K DISK
D X S 9S 0
I KEYFIELD L1 (CONTROL INDICATOR)
X += 1 ;
IF X <> 1 ;
DELETE RECORDFORMAT ;
CL1 RESET X
|Is This Answer Correct ?||0 Yes||2 No|
program to find the number of objects used in a given program through a display.
What is the compilation option that has to he specified while compiling an RPC program which uses a file having date data type field?
How can we search particular records from the database file in RPG. For example, 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?
while i am using the dspmsg command on comman line in Mocha am getting error like Not authorized to message queue message my messagequeue Name? can anybody help me how to change my message queue Am anable to see my messages in message queue
The PGMA calls PGMB.PGMB generates a report.The report should contain the called program name(PGMA).How do i get the called program name in PGMB to print it on the spool file?(calling program name should NOT be hard coded or passed as parameter to called program?
what is kids-rpg?
Assume my file has 100 records and I want to see only first 10 records. Is this possible through lf?
What will be your approach in going either for OPNQRYF or Logical files. Which one to go for?
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 .
Difference between creating a report using Printer file and WRKQRY(Query Report) ?
what r drawbacks of OPM? Why do we go for ILE RPG?
Can somebody tell me that, Is it possible to read all the member of PF without OVRDBF?