{"id":302,"date":"2011-12-25T22:18:18","date_gmt":"2011-12-26T04:18:18","guid":{"rendered":"http:\/\/tommysprinkle.com\/txxos\/?p=302"},"modified":"2021-04-17T18:24:31","modified_gmt":"2021-04-17T23:24:31","slug":"txxipl2d-writing-ipl-text-to-dasd","status":"publish","type":"post","link":"https:\/\/tommysprinkle.com\/txxos\/?p=302","title":{"rendered":"TXXIPL2D &#8211; Writing IPL Text To DASD"},"content":{"rendered":"<p>Before writing to a DASD volume it is a good idea to make a backup. \u00a0While I was testing TXXIPL2D I managed to erase the VOL1 record. \u00a0It is very easy to make a coding mistake that could leave the volume completely unusable. \u00a0In my case I was able to write a program that simply rewrote a VOL1 record and all was good. \u00a0If I had managed to damage the VTOC I would have had to format the volume resulting in a loss of all the data. \u00a0Since the only data on the volume I am writing to is for testing my TXX code it wouldn&#8217;t be the end of the world. \u00a0My source code is safely on another volume.<\/p>\n<p>Writing the IPL1 and IPL2 records is pretty straight forward. \u00a0Because they already exist on the volume we only need to update them. \u00a0We can use the Write Data (x&#8217;05&#8217;) to update the record data. \u00a0The Write Data command will only overwrite the data portion of the record. We Seek\/Search ID for the record we want to update and then chain on the Write Data. \u00a0If we write less data than the record size, the remainder of the record will be padded with zeros.<\/p>\n<p>To write the IPL Text in record 4 we need to use the Write CKD (Count, Key, Data) command. \u00a0This command will format a record on the track. \u00a0Any records following the record on the track will be erased. \u00a0(This is how I managed to erase the VOL1 record). \u00a0To use Write CKD we have to seek for the previous record. So to write record 4 we need to seek to record 3.<\/p>\n<p>The data\u00a0transferred\u00a0must include the eight byte count area, the key data (if any), and the data. \u00a0A record with a data length of zero is an End Of File (EOF).<\/p>\n<p>The count area is eight bytes long and has three fields &#8211; the record ID (CCHHR), the Key Length, and the Data Length. \u00a0The key length is 1 \u00a0byte (maximum 256) and the Data Length is 2 bytes.<\/p>\n<p>For our IPL text record no key is needed and the length is determined by the size of the IPL text data.<\/p>\n<p>To get the IPL text data we can read it from an object deck. \u00a0We can use a procedure\u00a0similar\u00a0to how we loaded an object deck in our Absolute Loader. \u00a0In this case we can load the the object deck into a work area that becomes the buffer for our write command.<\/p>\n<p>I also included the ability to read the DASD device address from a card. \u00a0The format 0f the control card is: DEVICE=xxx where xxx is the device address we will write to.<\/p>\n<p>To write the IPL text to our DASD volume we need to begin with our Absolute Loader. \u00a0It will then load and transfer execution to TXXIPL2D. \u00a0It will then the control card from the card reader. \u00a0Immediately following the control card should be the IPL object deck to write to the DASD.<\/p>\n<p>Here is the JCL I used:<\/p>\n<pre>\/\/IPL2D    JOB 5222,'IPL TO DASD',CLASS=A,MSGCLASS=A,\r\n\/\/        MSGLEVEL=(1,1)\r\n\/*JOBPARM K=0\r\n\/\/*\r\n\/\/*\r\n\/\/TXXOSRUN EXEC  PGM=ABSLOAD\r\n\/\/STEPLIB  DD    DISP=SHR,DSN=TXXOS.CARD.LOAD\r\n\/\/PUNCH    DD    UNIT=00D\r\n\/\/*\r\n\/\/*\r\n\/\/ASM      EXEC  PGM=IFOX00,REGION=1024K,\r\n\/\/         PARM='LINECOUNT(44),TERM'\r\n\/\/SYSLIB   DD    DISP=SHR,DSN=SYS1.MACLIB\r\n\/\/         DD    DISP=SHR,DSN=SYS1.AMODGEN\r\n\/\/         DD    DISP=SHR,DSN=TXXOS.DOS.ASM\r\n\/\/SYSUT1   DD    DSN=&amp;&amp;SYSUT1,UNIT=VIO,SPACE=(1700,(600,100))\r\n\/\/SYSUT2   DD    DSN=&amp;&amp;SYSUT2,UNIT=VIO,SPACE=(1700,(300,50))\r\n\/\/SYSUT3   DD    DSN=&amp;&amp;SYSUT3,UNIT=VIO,SPACE=(1700,(300,50))\r\n\/\/SYSTERM  DD    SYSOUT=*\r\n\/\/SYSPRINT DD    SYSOUT=*\r\n\/\/SYSPUNCH DD    UNIT=00D\r\n\/\/SYSIN    DD    DISP=SHR,DSN=TXXOS.DOS.ASM(TXXIPL2D)\r\n\/\/*\r\n\/\/GENR1    EXEC  PGM=IEBGENER\r\n\/\/SYSPRINT   DD  SYSOUT=*\r\n\/\/SYSIN      DD  DUMMY\r\n\/\/SYSUT2     DD  UNIT=00D\r\n\/\/SYSUT1     DD  *\r\nDEVICE=345\r\n\/*\r\n\/\/*\r\n\/\/GENR2    EXEC  PGM=IEBGENER\r\n\/\/SYSPRINT   DD  SYSOUT=*\r\n\/\/SYSIN      DD  DUMMY\r\n\/\/SYSUT2     DD  UNIT=00D,DCB=(BLKSIZE=80,LRECL=80)\r\n\/\/SYSUT1     DD  DISP=SHR,DSN=TXXOS.DOS.OBJ(TXXIPL)\r\n\/\/*<\/pre>\n<p>My TXXIPL module is simply an updated copy of the DBOOT3 program. \u00a0It will locate a data set named TXXOS.SYSLIB and then load TXXNUC into memory and transfer control.<\/p>\n<p>We now have the ability to IPL from a DASD volume.<\/p>\n<p>[Next &#8211; \u00a0<a title=\"TXXNUC\" href=\"http:\/\/tommysprinkle.com\/txxos\/?p=308\">TXXNUC<\/a>]<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Before writing to a DASD volume it is a good idea to make a backup. \u00a0While I was testing TXXIPL2D I managed to erase the VOL1 record. \u00a0It is very easy to make a coding mistake that could leave the &hellip; <a href=\"https:\/\/tommysprinkle.com\/txxos\/?p=302\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"template-page-builder-no-sidebar.php","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-302","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1CPQT-4S","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=\/wp\/v2\/posts\/302","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=302"}],"version-history":[{"count":4,"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=\/wp\/v2\/posts\/302\/revisions"}],"predecessor-version":[{"id":490,"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=\/wp\/v2\/posts\/302\/revisions\/490"}],"wp:attachment":[{"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=302"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=302"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}