{"id":52,"date":"2008-10-07T20:13:11","date_gmt":"2008-10-08T01:13:11","guid":{"rendered":"http:\/\/www.thefillmoregroup.com\/blog\/?p=52"},"modified":"2008-10-07T20:13:11","modified_gmt":"2008-10-08T01:13:11","slug":"asnclp-scripting-for-replication","status":"publish","type":"post","link":"https:\/\/www.thefillmoregroup.com\/blog\/?p=52","title":{"rendered":"ASNCLP Scripting for Replication"},"content":{"rendered":"<p>For those of you who have worked on IBM\u2019s SQL Replication (formerly DataPropagator-Relational) and Q Replication you are familiar with the Replication Center, a Java-based, fat-client which is part of Control Center.\u00a0 Replication Center is good for folks who are learning IBM\u2019s replication software suite or who have a single task that needs to be performed quickly.<br \/>\nOn the other hand, managing dozens or hundreds of subscriptions is impractical through the Replication Center.\u00a0 It makes more sense to use the replication scripting language called ASNCLP (ASN Command Line Processor).\u00a0 It is documented in ASNCLP Program Reference for Replication and Event Publishing (SC19-1018).<br \/>\nTo invoke ASNCLP, first install the DB2 Data Server Client (available for free at <a href=\"http:\/\/www-01.ibm.com\/support\/docview.wss?rs=71&amp;uid=swg21288110\">http:\/\/www-01.ibm.com\/support\/docview.wss?rs=71&amp;uid=swg21288110<\/a>) or one of the DB2 engines such as Enterprise Server Edition (which bundles the client functionality).\u00a0 If you already use Replication Center, you have what you need to use ASNCLP.<br \/>\nThen type ASNCLP at any Windows DOS prompt for an interactive ASNCLP session.\u00a0 Alternatively, code a script using the ASNCLP language and run that file as follows:<\/p>\n<p>ASNCLP -f queue_map.qrp<\/p>\n<p>In order to run the following script, you must configure access to the source and target DB2 databases \u2013 in this case D01G and D03G &#8211; which both happen to be DB2 for z\/OS subsystems.<\/p>\n<p>queue_map.qrp<br \/>\n# Setting the environment.<br \/>\n# The SET OUTPUT command creates two SQL scripts: qcapqmap.sql, which adds<br \/>\n# definitions for the queue map to the Q Capture control tables, and<br \/>\n# qappmap.sql, which adds definitions for the queue map to the Q Apply<br \/>\n# control tables.<br \/>\nASNCLP SESSION SET TO Q REPLICATION;<br \/>\nSET LOG &#8220;rqmap.err&#8221;;<br \/>\nSET SERVER CAPTURE TO DB D01G ID V110079 PASSWORD &#8220;xxxxxxxx&#8221;;<br \/>\nSET CAPTURE SCHEMA SOURCE ASN;<br \/>\nSET SERVER TARGET TO DB D03G ID V110079 PASSWORD &#8220;xxxxxxxx&#8221;;<br \/>\nSET APPLY SCHEMA ASN;<br \/>\nSET OUTPUT CAPTURE SCRIPT &#8220;qcapmap.sql&#8221; TARGET SCRIPT &#8220;qappmap.sql&#8221;;<br \/>\nSET RUN SCRIPT LATER;<\/p>\n<p># Creating a replication queue map.<br \/>\n# This command generates SQL to create a replication queue map,<br \/>\n# SAMPLE_ASN1_TO_TARGET_ASN1. It specifies a remote administration<br \/>\n# queue and receive queue at the Q Apply server, and a send queue at<br \/>\n# the Q Capture server. The command also sets the number of agent threads<br \/>\n# for the Q Apply program to 4 (a quarter of the default 16), and specifies<br \/>\n# heartbeat messages be sent every 5 seconds.<\/p>\n<p>CREATE REPLQMAP SAMPLE_ASN1_TO_TARGET_ASN1<br \/>\nUSING ADMINQ &#8220;ABC.ALL.ASN1.DB2.ADMIN&#8221;<br \/>\nRECVQ &#8220;ABC.ALL.ASN1.DB2.DATA&#8221;<br \/>\nSENDQ &#8220;ABC.ALL.ASN1.DB2.DATA&#8221;<br \/>\nNUM APPLY AGENTS 4<br \/>\nERROR ACTION S<br \/>\nHEARTBEAT INTERVAL 5;<\/p>\n<p># Ending the ASNCLP session.<br \/>\nQUIT;<\/p>\n<p>The resulting files, qappmap.sql and qcapmap.sql are run when attached to the Q Apply DB2 server (&#8220;target&#8221;) and Q Capture DB2 server (&#8220;source&#8221;) respectively.\u00a0 These are standard SQL statements and can be run from anywhere (Command Editor on Windows, SPUFI on ISPF\/PDF, etc.).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For those of you who have worked on IBM\u2019s SQL Replication (formerly DataPropagator-Relational) and Q Replication you are familiar with the Replication Center, a Java-based, fat-client which is part of Control Center.\u00a0 Replication Center is good for folks who are learning IBM\u2019s replication software suite or who have a single task that needs to be [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[19,234],"class_list":["post-52","post","type-post","status-publish","format-standard","hentry","category-wwwthefillmoregroupcomdb2consultingphp","tag-asnclp","tag-wwwthefillmoregroupcomdb2consultingphp"],"_links":{"self":[{"href":"https:\/\/www.thefillmoregroup.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/52","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thefillmoregroup.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thefillmoregroup.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thefillmoregroup.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thefillmoregroup.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=52"}],"version-history":[{"count":2,"href":"https:\/\/www.thefillmoregroup.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/52\/revisions"}],"predecessor-version":[{"id":54,"href":"https:\/\/www.thefillmoregroup.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/52\/revisions\/54"}],"wp:attachment":[{"href":"https:\/\/www.thefillmoregroup.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=52"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thefillmoregroup.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=52"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thefillmoregroup.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=52"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}