Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Programs affected by a change in Table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
arunswap

New User


Joined: 23 Mar 2006
Posts: 13

PostPosted: Thu Apr 06, 2006 5:45 pm    Post subject: Programs affected by a change in Table
Reply with quote

If I make a change to a table, how to know the effect that it will have on other programs using that table.
Back to top
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Fri Apr 07, 2006 1:29 pm    Post subject:
Reply with quote

Hi arunswap,

First make a fairscan on that table to identify which programs are using that particular table.

2) What changes u r making in table
a) If u adding new coloumn than u have to change all those program
that have the query like that
Select *
From tablea
Where .....
b) if u renaming some coloumn ( changing fielda to fieldb)than u have
to change name of that Particular colum in each program that have
the sql like

Select fielda
from tablea
Where .....
c) if u changing defination of some coloumn than u have to make
change length of corrosponding host variable in all those pgm which
have query that contain that particular coloumn

Hope it will helpful
Back to top
View user's profile Send private message
twissi

Active User


Joined: 01 Aug 2005
Posts: 105
Location: Somerset, NJ

PostPosted: Thu Apr 20, 2006 3:39 pm    Post subject:
Reply with quote

Hi Arun,

The first thing you've to do when there was a table change is modifing the DCLGEN & copybook to reflect the change and recompile the associated programs.

Before recompiling the programs you'll have to make sure that you've changed the embedded SQLs accordingly.

As an example, let's assume that there were 10 fields in the table and after the change being applied to the table, there're 11 fields now including the new one added at the end, which is defined as NOT NULL. If your program is doing an insert operation and you haven't modified the SQL, the insert operation will fail giving a code of -407.

The explanation is you were trying to insert a null value into a non nullable column.


In brief, you'll have to change the copybooks/SQL statements depending up on the situation.

Cheers, Twissi.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts Cobol list of programs being called biswajit.dattagupta COBOL Programming 5 Tue Nov 01, 2016 2:10 am
No new posts Can sending 5 MB data between cobol p... Kevin Vaz CICS 12 Tue Oct 18, 2016 4:50 pm
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us