{"id":230,"date":"2012-08-10T13:21:08","date_gmt":"2012-08-10T13:21:08","guid":{"rendered":"http:\/\/62.131.51.129\/wordpress\/?p=230"},"modified":"2012-08-10T13:21:08","modified_gmt":"2012-08-10T13:21:08","slug":"querying-a-db2-database-on-a-mainframe","status":"publish","type":"post","link":"http:\/\/archief.van-maanen.com\/?p=230","title":{"rendered":"Querying a Db2 database on a mainframe"},"content":{"rendered":"<p>Recently, I was in a situation where I had to query a Db2 database on a mainframe. I was also in a situation where the knowledge and documentation on that mainframe was not very widespread. So there I found myself, sitting in the dark with only a so-called 3270 screen looking at me, waiting for a first step that I would take.<\/p>\n<p>The first question: how are the tables called. Second question: what tools to use to query the database.<\/p>\n<p>I remembered from a distant past that IBM has a so-called &#8220;File-Aid&#8221; for Db2. This tool has a browse option that allows you to browse\u00a0interactively tables in a Db2 database. The nice thing about it that the browse mode accepts wild-cards like *. When multiple answers are possible a pop-up appears that gives a clear choice on the possiblities. I used this tools to get a hunch of the table-names and to get a first impression on the content of the tables.<\/p>\n<p>Once I had a list of filenames, I started with a second tool that gave me more insight. This tool is called &#8220;Spufi&#8221;. This tool basically uses two files (or datasets as they are called on a mainframe). One file is used to store the SQL statements, whereas a second dataset is used to capture the output. I realised that the two files must be allocated beforehand and that both files could best reside under your own name. I created two files: &#8220;tom.input.sql&#8221;\u00a0 and &#8220;tom.output.txt&#8221;. I then used these two names in the first screen of Spufi where the exact names of input- and output files is being asked for.<\/p>\n<p>This allowed me to start investigating the database.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently, I was in a situation where I had to query a Db2 database on a mainframe. I was also in a situation where the knowledge and documentation on that mainframe was not very widespread. So there I found myself, sitting in the dark with only a so-called 3270 screen looking at me, waiting for [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-230","post","type-post","status-publish","format-standard","hentry","category-nice-to-know"],"_links":{"self":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/posts\/230","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=230"}],"version-history":[{"count":0,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/posts\/230\/revisions"}],"wp:attachment":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=230"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}