×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Request for File process code!!!!!

Request for File process code!!!!!

Request for File process code!!!!!

(OP)
Dear Friend,

I am new to COBOL programming language. Could you please help me with the below mentioned requirement...

I have 2 input files with below mentioned format

Input file 1 :
**************
SNO X(03)
CODE X(09)
NAME X(68)
Input file 2 :
**************
CODE X(09)
CID X(09)
FILLER X(62)

My aim is to compair the Input file 1 with the input file 2 with CODE value. If the CODE in the input file 1 found the match code from the input file 2 then the o/p should be write in one file. If not found it needs to be write in the other file.


For example:
************
Input file 1 data:
******************
123aaaaaaaaa----------------------
456bbbbbbbbb----------------------
586rrrrrrrrr----------------------
Input file 2 data:
******************
aaaaaaaaa11111111111*************
ccccccccc11111111111*************
qqqqqqqqq11111111111*************

In this scenerio the o/p file 1 should contains
123aaaaaaaaa----------------------

and the o/p file 2 should contains
456bbbbbbbbb----------------------
586rrrrrrrrr----------------------

Thanks in advance for your help :)

Thanks,
Vinoth R

RE: Request for File process code!!!!!

Suggest you post on only one(1) forum. . .

What you want is a 2-file match/merge (sometimes called a "line balance") routine.

At the top of the COBOL part of the "other" forum is working code for exactly what you are looking for. . .

RE: Request for File process code!!!!!

Here's a simple steps:
1 Read input 1 and create an index file using CODE as index. this has to be unique. Bypass creation if CODE already created. Close input 1 and index file at end of record.

2. Open index file and Read input 2 and find a match against the index file using code value. If found then write to an output file else write to another output file.

If you want step by step program syntax then I suggest to read back your cobol reference guide.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close