Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading a 2nd file into a program 1

Status
Not open for further replies.

jssgth

Programmer
Mar 29, 2001
2
US
HELP! I'm a programming student at a community college and we have a cobol assignment that I'm having a little bit of difficulty with - and truly am green. Our book is Stern & Stern, Structured COBOL Programming, 9th Edition if that is of any use.
We have our first file read in and are able to get required ouput.
Now we have to read a 2nd file into the same program, store that data in an array, use a loop to cycle thru the array to match the social security number in file 2 (the array) to the ssn from file 1, when a positive match, print the Name on output.
I'm fairly confident (at the moment) that I can create the array - just don't have a clue on reading in subsequent files.
Anyone up to walking me thru this?
Thanks in Advance
--- Jan
 
Hi JS,

Gotta help someone w/JS for their initials. :)

Your problem is not as bad as you think. Just define the new file as you did the 1st; change the names, of course. Open it; read it & fill the array via a loop; and close it as you did the 1st.

Easy, heh? ;-) Jack.
 
cool! thanks for not making me feel more like a dufus!
another question - logic tells me to open my file 2 - read it, dump it to the array, close it, then open my file 1??? am i thinking along the right lines? and thanks for the quick response! JS!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top