Thanks Mark! I will look at this as a possible solution. David Logan
-----Original Message----- From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On Behalf Of Mark Zelden Sent: Monday, February 04, 2008 1:06 PM To: [email protected] Subject: Re: How to find "current tape length" programatically On Mon, 4 Feb 2008 11:58:22 -0700, David Logan <[EMAIL PROTECTED]> wrote: >Yes, I'm writing to 3490E cartridges, afaik. I didn't know that they were >being discontinued. I'm going to have to find documentation on that. > >The requirements are easy. We ship tapes to a hardware duplication service. >That means they mount our tape on one side, and a stack of tapes on the >other side, and push a button. > >Thus, the data on the "source" tape must be under the "guaranteed tape >length", otherwise some of the target tapes won't be long enough. > >So, I can have multi-volume datasets, BUT, the portion of each file must be >under the guaranteed minimum length. > >What our other office does is this: They write files to tape. When they hit >a file that causes a tape switch, they back off, rerun the job with one less >file, and start another tape with that file. Very crude. > >I want a better way. I want to be able to write X number of IDRC compressed >(bytes/blocks) to a tape, and know for a fact that I am up to the point of >guaranteed tape length, and then switch tapes. > >On a 3480 without IDRC compression, it's easy. I write 8,139 blocks if >24,576 bytes. Then I switch tapes. On a drive with compression, it's not >that easy. And I don't like the way my other shop does it. It's hokey, >manual and error prone. > When I wrote a tape stacking program (REXX) a long time ago I just assumed a certain amount of compression based on IDRC or LZ-1 and I also set a fudge factor for when I would consider the tape full. I had a few clients that used my program and I got excellent results. After the "customization values" were set (after some test runs) we never ran into problems with a "tape switch". I had a client that ran the stacking program every couple of months so all their media could fit in their automated library. Here is an example of the values set in the customization section of my program: MAXHOLD = 800000000 /* 3490E 36 track tape will hold 800M */ TAPEFULL = 750000000 /* start new tape if at least 750M */ SKIPAMT = 150000000 /* if tape has 150M or more, skip it it */ COMPRESS = 50 /* assume 50% compression for IDRC tapes */ MAXVB = 90 /* assume 90% of vb records are max */ Here is a some more of the code that showed how I calculated how full the tape was: /* */ /* Calculate approximate amount of tape used. */ /* */ TAPEUSED = BLKSIZE * BLKCOUNT /* */ /* */ /* If variable records - assume MAXVB% are the max lrecl */ /* */ If VARBIT = 'ON' then TAPEUSED = TAPEUSED * (MAXVB /100) /* */ /* If compacted tape (IDRC) - assume COMPRESS% compaction - or */ /* if uncompacted tape and the output will be compacted */ /* assume COMPRESS% compaction */ /* */ If TMDEN = '38KC' | IDRC = 'YES' then , TAPEUSED = TAPEUSED * (1-(COMPRESS/100)) /* */ /* Add in the Inter Block Gaps (IBG) */ /* */ /* The density of a 3480 cartrige is: */ /* 1491 characters per millimeter American National Standard */ /* */ /* 1 inch = 2.54 centimeters or 25.4 millimeters */ /* 1 character = 1 byte */ /* 1491 * 25.4 = 37871 bytes per inch (38K BPI) */ /* */ /* The IBG is .08 inches */ /* 37871 * .08 = 3030 bytes */ /* */ If TMDEN <> '3590' then , /* 3590 IBG is always compressed */ TAPEUSED = TAPEUSED + (BLKCOUNT * 3030) /* add in IBGs */ /* */ You can see the entire program called TAPESTAK on CBT file 434 or my web site in the "programs" section. URL below. -- Mark Zelden Sr. Software and Systems Architect - z/OS Team Lead Zurich North America / Farmers Insurance Group - ZFUS G-ITO mailto:[EMAIL PROTECTED] z/OS Systems Programming expert at http://expertanswercenter.techtarget.com/ Mark's MVS Utilities: http://home.flash.net/~mzelden/mvsutil.html ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html

