×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

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!

*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

multiple table access in COBOL

multiple table access in COBOL

multiple table access in COBOL

(OP)
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!

RE: multiple table access in COBOL

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 . . .

RE: multiple table access in COBOL

(OP)
Yes, I understand that this is preferable but is it possible syntactically?
Thanks!

RE: multiple table access in COBOL

This can be done by two way:
1. Please check on the below link
http://mainframealldtime.wordpress.com/2012/05/01/...

or,
2. develop a store procedure or sub program and call the sub program with different year value.

Please let me know if you have any question.

RE: multiple table access in COBOL

(OP)
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!

RE: multiple table access in COBOL

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.

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