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
OPCODES
| 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 ? | 5 Yes | 1 No |
Answer / raghav
1. TESTD
2. Delete from File1 F1 where RRN(f1) > (select MIN(RRN(F2)) from File1 F2 where F2.Field1 = F1.Field1)
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / chandu
We can delete duplicate records by using this:
factor1 opcode factor2 result eq
key setll pf
reade pf 50
dow *in50=*off
delete rec1
reade pf 50
enddo
| Is This Answer Correct ? | 4 Yes | 4 No |
FPF#4 UF E K DISK
C 'ABC ' SETLLR1 44 25
C *IN55 DOWEQ*OFF
C READER1 55
C *IN55 IFEQ *ON
C LEAVE
C ENDIF
C DELETR1
C ENDDO
C SETON LR
| Is This Answer Correct ? | 0 Yes | 0 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
/FREE
TESTD(E) *ISO(WHAT EVER) DATE VARIABLE ;
IF %ERROR ;
DO SOME THING ;
ENDIF ;
/END-FREE
2: CREATE A LOGICAL ON THAT FILE WITH KEY SAY FILE1
IN RPG
FFILE1 IP E K DISK
D X S 9S 0
D
I RECORDFORMAT-FILE1
I KEYFIELD L1 (CONTROL INDICATOR)
/FREE
X += 1 ;
IF X <> 1 ;
DELETE RECORDFORMAT ;
ENDIF ;
/END-FREE
CL1 RESET X
| Is This Answer Correct ? | 0 Yes | 2 No |
Hi, I am getting the error in RPG (All Record Formats for externally-described file ABCD ignored or dropped due to error; file ignored.) Please suggest any
Set on command is used for closed all opened files , initialize var and release resource , return cmd is used for return to calling program but my req. Is dnt close opened files and resource must released while doing transactions , how can i do this...?
How to search particular records from the database file in rpg?
how can we know running job is batch or intractive ? i need all the possibilites.........plz help me
1) How to retrieve RRN through RPG ? 2) How to pass parameter by value ? 3) How to trap the error through the RPG/400
10 Answers IBM, Tech Mahindra,
if i have three programs progA,progB and progC .now i call progB from progA. but the progB does not exist . now i want to call progC instead of starting dump. how can we achieve this.
Anybody can explain the difference between SFLCLR & SFLINZ?
how do I declare a table or array in rpg iv?
1. If there are two programs using same file and 2 users are using the file at the same time and what can be done to allow them both to access? 2. How can remove lock from the file for accessing it by both users?
How do you code file / field renames in ILE RPG?
What is the purpose of PUTOVR keyword?
how to convert date format from one format to another i think in CL/400 its CVTDAT,Please tell in RPG/400 sir not in RPGILE