Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
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 BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 21 Sun Aug 27, 2017 10:35 pm
No new posts How do you create Eclipse based dialogs jasorn IBM Tools 0 Thu Aug 03, 2017 5:05 pm
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am

Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us