IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

COBOL-Common routine that contains all SQLs for a table


IBM Mainframe Forums -> COBOL Programming
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
Madhubalan Periyasamy

New User


Joined: 09 Aug 2021
Posts: 1
Location: Sweden

PostPosted: Mon Aug 09, 2021 4:13 pm
Reply with quote

Has anyone worked on a project where you have written a code with similar specifications writtten below?
If yes, can you share your experience on how good or bad this is compared to the traditional approach of embedding the SQL directly in a module?
SPEC:
Lets assume that we have a table called EMPLOYEE. and an application written in COBOL.
Instead of embedding the SQL to access this table in every program that has to access this module, we create a sub-module that contains all possible SQL statements (SELECT,UPDATE,DELETE, INSERT) used on that table.
So whenever there is a need to access this table, we just call the sub-module with enough input.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Mon Aug 09, 2021 5:10 pm
Reply with quote

Typical imbecile PHB idea.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Mon Aug 09, 2021 10:47 pm
Reply with quote

It really doesn’t matter , update , delete operations may have different where conditions which you cannot achieve thru one module unless you build dynamic sqls.
Second , it’s easier and flexible to control sqls if you write your own in the program as per requirements and it works pretty well.

Only in case of vsams I have seen using one I/o module to perform all such operations as it was critical to the application and it’s easier to manage by one module than many programs plus buffering , performance , contention issues reduce to almost none using one module.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Wed Aug 11, 2021 1:22 pm
Reply with quote

If you want replies ask for them here, not in PMs, unless you yourself are the PHB.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2011
Location: USA

PostPosted: Wed Aug 11, 2021 7:45 pm
Reply with quote

Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 2
No new posts Load new table with Old unload - DB2 DB2 6
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top