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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple table access in COBOL

Status
Not open for further replies.

katbar

Programmer
Jun 22, 2012
3
US
This may be a silly, newby question but I am tasked with writing some COBOL code with which I am not very familiar with (fairly new to cobol and won't be on this team long!). The code I have to write entails updating the same SQL Server table for 2 different years and not sure how to write the code for this. I can't seem to find good examples. Do I have 2 seperate cursors open at the same time or am I forced to process them one entire cursor at a time? I basically want two copied of the same table
thanks!
 
Suggest you process one year at a time and not try to work with them concurrently in the code.

Possibly , i misunderstand what you want to do . . .
 
Yes, I understand that this is preferable but is it possible syntactically?
Thanks!
 
If I am to interpret this correctly, if I declare 2 cursors (using alias) for the same table, different years and FETCH them into different working storage areas, I should be OK. They should keep separate references. Thanks for your time!
 
Yes, what you propose can be made to work . . .

If this is other than a one-time process, suggest you write the "main" part of the code to "drive" a subprogram or stored procedure to actually do the work.

This way there is no duplication of the code and it will be less work if there needs to be a third year one day.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top