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 Usergroups Profile Log in to check your private messages Log in
 

 

Write only matched records in file using cobol

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

New User


Joined: 26 Jul 2012
Posts: 4
Location: india

PostPosted: Thu Jul 26, 2012 12:56 pm    Post subject: Write only matched records in file using cobol
Reply with quote

There are two files

FileA FileB
1 3
3 4
5 6
7 7
9 8

now i need in output file only matched records - 3 and 7 ..
and also this is jus sample input file i have given.. actual input file has 'n' number of datas//

Write matched records in file using cobol only
Back to top
View user's profile Send private message

rakesh1155

New User


Joined: 21 Jan 2009
Posts: 84
Location: India

PostPosted: Thu Jul 26, 2012 2:24 pm    Post subject: Reply to: Write matched records in file using cobol only
Reply with quote

I googled "File matching in cobol" and got a lot of links explaining the logic.

Here is one of them:
Link from a competitive site is removed

Also, There is tested sample code to accomplish a 2-file match/merge posted as a "Sticky" at the top of the COBOL part of the forum.
http://ibmmainframes.com/viewtopic.php?t=22649
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Jul 26, 2012 2:36 pm    Post subject:
Reply with quote

PS.: Rakesh - per the Forum rules I've removed one of the links from your post. If you ask, why? Well, posting such links is against Forum rules.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Jul 26, 2012 2:39 pm    Post subject:
Reply with quote

yasho_bala -- have you tried something, to start with? Forget about the language used, what pseudo code will you write for it? It's a simple file-matching logic and there are plenty of example of that sort over internet and on Forums like this, as Rakesh has also indicated.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jul 26, 2012 7:00 pm    Post subject:
Reply with quote

Hello,

If you have never written code to "match" 2 files, suggest you review the code attached to the "Sticky" at the top of the COBOL part of the forum.

Many of the examples found on the internet are incomplete or just plain wrong.

As this is such a common requirement, suggest you start with tested, working code and expand on this as needed. There is no reason to start from scratch. The code in the sticky is being used very many places.

If you have questions about something in the code, post the bit of code where you have a doubt and someone will be able to clarify.
Back to top
View user's profile Send private message
rakesh1155

New User


Joined: 21 Jan 2009
Posts: 84
Location: India

PostPosted: Fri Jul 27, 2012 12:36 pm    Post subject: Reply to: Write matched records in file using cobol only
Reply with quote

Anuj, I am not going to ask the question "why".

I just copy-pasted the first link that I got when I googled. Thanks for not issuing a warning for posting a link from a competitive site. icon_smile.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri Jul 27, 2012 1:04 pm    Post subject:
Reply with quote

icon_smile.gif - No problem, I usually don't issue a 'yellow-card', unless it's too compelling!

Have a nice stay here,
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 641
Location: Whitby, ON, Canada

PostPosted: Fri Jul 27, 2012 6:02 pm    Post subject:
Reply with quote

<nostalgia> Back when developers were called "Programmers", coding a two file match program, from scratch, was considered an essential part of the training process. Most people struggled when they first encountered this task, but they learned a lot in the process. Of course, some learned only that programming wasn't what they wanted to do with their careers. For others, it was quite the opposite. icon_cool.gif <\nostalgia>
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri Jul 27, 2012 6:54 pm    Post subject:
Reply with quote

/Perhaps On

Quote:
Back when developers were called "Programmers"
Over the years, the perception is also changed, I believe. In my small career, I find that, people "know languages" but they don't know "programming" and that's why they are "developers" and not called "programmers" anymore...

/Perhaps Off
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Jul 27, 2012 7:21 pm    Post subject: Reply to: Write matched records in file using cobol only
Reply with quote

Programming has become ah, uh, umm, like work . . . And maybe we can get someone to do this for us . . .

Being a developer is more grand. . .

icon_wink.gif
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Fri Jul 27, 2012 8:16 pm    Post subject:
Reply with quote

Well, I generally style myself a "developer". However, this is because over the past 15-20 years I have more and more had to wear several hats simultaneously: business analyst (determine requirements), system analyst (translate requirements into design), and programmer (implement design). "Test analyst" (execute program and write report detailing defects for programmer to ignore) seems to be considered a separate role these days, although back in the day programmers took their programs through system test.
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 961
Location: Richmond, Virginia

PostPosted: Fri Jul 27, 2012 9:14 pm    Post subject:
Reply with quote

Several years ago I was successful in being hired for a contract SAS programming position.

As everyone else on the team was SAS certified, the hiring manager asked why I was not SAS certified. I replied that certification merely showed that you knew what the pieces were, but said nothing about how you put them together. To his credit, the hiring mananger liked this answer.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Fri Jul 27, 2012 9:22 pm    Post subject: Reply to: Write matched records in file using cobol only
Reply with quote

we should start defining some PC ( politically correct ) terms to define these <new> figures

for example in Italy the PC name for the garbage/trash/... collector/man is "ecological operator"

along the lines that a bald man could be defined as hairbrush impaired icon_biggrin.gif
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Fri Jul 27, 2012 9:44 pm    Post subject: Re: Reply to: Write matched records in file using cobol only
Reply with quote

enrico-sorichetti wrote:
for example in Italy the PC name for the garbage/trash/... collector/man is "ecological operator"

A friend (who is a real engineer; MS, PE, specializes in coal-fired power plants) complained about the misappropriation of "engineer" to lend prestige to unskilled jobs, as with garbage collectors being called "sanitation engineers". I told her not to worry, as they were now styled "post-consumer resource analysts" icon_lol.gif
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 641
Location: Whitby, ON, Canada

PostPosted: Fri Jul 27, 2012 10:15 pm    Post subject:
Reply with quote

Where I live, in Ontario, Canada, the Association of Professional Engineers regularly takes to task any organization misusing the term "engineer". Only licensed Engineers are allowed to call themselves engineers. In the most recalcitrant cases they take legal action.

One reason this distinction is important is that Engineers are legally accountable for their work. Imagine being sued for malpractice every time one of your programs abended. I would have been out of business years ago.

I am not an engineer, but am a proud father of one. icon_smile.gif
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 Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


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