DSNTESD
Check data sharing setup CHANGE ACTIVITY 11/07/2012 Add SET CURRENT SQLID dn1651_inst1 / dn1651 05/17/2013 FIX COPYRIGHT STATEMENT 49779_077_724 - - Set the current authorization ID to perform the work - SET CURRENT SQLID =.
----------------------------------------------------------------------- 00001000
-- NAME = DSNTESD 00002000
-- 00003000
-- DESCRIPTIVE NAME = Check data sharing setup 00004000
-- 00005000
-- LICENSED MATERIALS - PROPERTY OF IBM 00006000
-- 5615-DB2 00007001
-- (C) COPYRIGHT 1982, 2013 IBM CORP. ALL RIGHTS RESERVED. 00008001
-- 00009000
-- STATUS = VERSION 11 00009100
-- 00009200
-- FUNCTION = Check data sharing setup 00009300
-- 00009500
-- CHANGE ACTIVITY 00009600
-- 11/07/2012 Add SET CURRENT SQLID dn1651_inst1 / dn1651 00009800
-- 05/17/2013 FIX COPYRIGHT STATEMENT 49779_077_724 00009901
----------------------------------------------------------------------- 00010000
00010100
----------------------------------------------------------------------- 00010200
-- Set the current authorization ID to perform the work 00010300
----------------------------------------------------------------------- 00010400
SET CURRENT SQLID = 'SYSADM'; 00010500
00010600
-- To test your data sharing setup, run SPUFI with this file as -- 00011000
-- input on each member of your data sharing group. -- 00020000
-- -- 00030000
-- To avoid the possibility of deadlocks on the PARTS table when -- 00040000
-- multiple members run this job concurrently, lock the table in -- 00050000
-- exclusive mode: -- 00060000
-- -- 00070000
LOCK TABLE DSN8!!0.PARTS IN EXCLUSIVE MODE; 00080000
-- -- 00090000
-- Determine the number of rows the PARTS table starts with: -- 00100000
-- -- 00110000
SELECT COUNT(*) AS ITEM_COUNT FROM DSN8!!0.PARTS; 00120000
-- -- 00130000
-- Insert five new rows: -- 00140000
-- -- 00150000
INSERT INTO DSN8!!0.PARTS 00160000
VALUES ( '463256' , 'RULER' , NULL , 'LOWE' ); 00170000
INSERT INTO DSN8!!0.PARTS 00180000
VALUES ( '000111' , 'PENCIL' , 'YELLOW', 'MIYAZAWA'); 00190000
INSERT INTO DSN8!!0.PARTS 00200000
VALUES ( '151617' , 'PEN' , 'BLUE' , 'LE' ); 00210000
INSERT INTO DSN8!!0.PARTS 00220000
VALUES ( '709031' , 'SCISSORS' , NULL , 'LA ROSA' ); 00230000
INSERT INTO DSN8!!0.PARTS 00240000
VALUES ( '189431' , 'LETTER OPENER', 'SILVER', 'PACIFIC' ); 00250000
-- -- 00260000
-- Do a SELECT with an ORDER BY clause to verify that your data -- 00270000
-- sharing group can access the workfile database: -- 00280000
-- -- 00290000
SELECT * FROM DSN8!!0.PARTS ORDER BY COLOR; 00300000
-- -- 00310000
-- Count the number of rows again. It should have increased by five: -- 00320000
-- -- 00330000
SELECT COUNT(*) AS ITEM_COUNT FROM DSN8!!0.PARTS; 00340000