Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Need to exclude the records based on partial fields.........

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
rz061m

New User


Joined: 03 Mar 2006
Posts: 48
Location: Chennai

PostPosted: Fri Jun 01, 2007 10:40 am    Post subject: Need to exclude the records based on partial fields.........
Reply with quote

Hi,

I have File1 & File2, see below for sample records.
If File1 contains the record as (80 10 _ _), _ for spaces, then all the records starting with 80 10 has to be excluded from File2 and the remainig records need to be written to the output file.
Same applies to all the remaning records in the File1.

See below for sample records in File1 & File2


File1: Exclusion file
80 10 _ _
80 20 _ _
90 20 _ _
100 10 20 _
110 20 30 40

_ for spaces

File2: Claims File
80 01 20 30
80 10 20 30
80 20 22 30
81 21 22 23
90 10 10 30
90 20 10 30
100 10 20 20
100 10 20 30
110 20 30 40
110 30 40 50

Output file:
81 21 22 23
90 10 10 30
110 30 40 50


Thanks,
RZ061M
Back to top
View user's profile Send private message

rz061m

New User


Joined: 03 Mar 2006
Posts: 48
Location: Chennai

PostPosted: Fri Jun 01, 2007 11:05 am    Post subject:
Reply with quote

Hi,

The output file will contain four record in it aganist the three posted earlier......
Please note that these 2 files are Sequential files.

Output file:

80 01 20 30
81 21 22 23
90 10 10 30
110 30 40 50


thanks,
Karthik. P
Back to top
View user's profile Send private message
Raphael Bacay

New User


Joined: 04 May 2007
Posts: 58
Location: Manila, Philippines

PostPosted: Fri Jun 01, 2007 11:54 am    Post subject:
Reply with quote

You can try the following method:

Sort both files.

read file1
read file2
perform until end of file1 or file2
case record1 = record2
read file1
read file2

case record2 < record1
write record2
read file2

case record1 < record2
read file1
end-perform

You can probably use the whole record for comparison instead of a key.

I hope it works...
Back to top
View user's profile Send private message
Raphael Bacay

New User


Joined: 04 May 2007
Posts: 58
Location: Manila, Philippines

PostPosted: Fri Jun 01, 2007 12:02 pm    Post subject:
Reply with quote

I have addenum...

You can try the following method:

Sort both files.

read file1
read file2

perform until end of file2

case record1 = record2
read file1
read file2

case record2 < record1
write record2
read file2

case record1 < record2
read file1

case end of file1
write remaining records to output file

end-perform
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm
No new posts Inefficient BUILD - VB records paddin... Daniel Prosser SYNCSORT 4 Thu Dec 14, 2017 3:52 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us