I want to remove a duplicates form a given input field using cobol program. please Any one help me out to solve this ... Thanks in Advance.
Answer Posted / naveenkumar m
As few answered for VSAM file dedup, I will explain for PS flat files,
1) Make sure your file is sorted either Ascending or descending using SORT.
2)FIRST-READ PARA
READ INPUT-FILE INTO WS-ARRAY()
UNTIL EOF
ARRAY-COUNT=ARRAY-COUNT + 1
3)PERFORM COMPARE-PARA VARYING I FROM 1 BY 1 UNTIL I < ARRAY-COUNT
IF WS-ARRAY(I)=WS-ARRAY(I+1) THEN
WRITE DUPLICATE-RECORDS
ELSE
WRITE NODUPLICATE-RECORDS
END-PERFORM
=====================================
I just given algorithm not exact code....
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Mention the guidelines to write a structured cobol program?
I have one ps file in which there are 3 fileds emp_no,emp_name and leave_app.this ps file information give the detail of employee which is going to apply for leave.suppose emp_no=113430,emp_name=ajay,leave_app=1 that means he is going to apply for 1 day leave.and accordingling the table in db2 will be updated means if he has that no of leave in his account then he will get dat leave and updated acc. in table(leave_balance=previous leave present in table-leave_app).Now i want to check whther the updated result is correct or not by comparing the two ps file using IEBCOMPARE or icetool so what is going to be the two ps file and how its is going to be compare.
What is a SSRANGE and NOSSRANGE?
Write down the divisions of cobol program?
what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.
Write a program to enter and display the names of students in a class using the occurs clause.
How to get the last record in vsam file in cluster? And how can you get the kids file records into your cobol program?
What rules are followed by the search verb.
Can a Search can be done on a table with or without Index?
How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?
How to get the last record in vsam file in cluster? And how can you get the ksds file records into cobol program?
What is the LINKAGE SECTION used in COBOL?
) How do u handle errors in BMS macro
)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?
i want a program using by if, evaluate , string, unstring, perform, occurs?