Home Up Search Credits Site Map Contact Info. Links Disclaimer Download

Make AWSTape

By Jay Moseley

What started out to be a Q&D program, ended up being something I thought might be worth sharing here.  Then it grew into a major project that took a couple of weeks to complete.  Can you say "mission creep"?

Basically I wanted to be able to read in ASCII, Line Sequential files and build AWSTAPE image files that could be read and processed under MVT/MVS.  I suppose that I could have kept it simple and it would have remained a Q&D solution to a specific need.  But, I expanded it to be able to optionally:

allow the specification of a blocking factor for the output datasets

allow the specification of the logical record length for the input and output data

allow the option of writing data from all input files into a single output file or writing the data from each input file into a unique output file. 

I know it will probably draw some criticism because I wrote it in BASIC, but I was writing pretty complex BASIC code long before I heard of C++ and can still turn out a BASIC program faster than the C++ equivalent.  I still have and use the final release of Microsoft's Professional Development System which is way beyond the dinky QBASIC that is stuck on all the DOS/Windows systems now.

Thanks to the diligence of Rob Dieters in finding my misplaced Tape Marks as I worked out the single/multiple output files, I finally got all the options working as I envisioned them.  Then I spent another week writing C equivalents of the original program and getting that to the point it would produce the AWSTAPE image files over under Linux.  Even though the compiled BASIC versions ran under DOSEMU, I wanted to have a native version.

The source is included in the archives available for download, so you can look at the source to see what I am doing if you are interested.  Note that I am not primarily a C programmer, so please don't send me harsh criticism of my C coding style.  Otherwise if something seriously needs correcting, do please let me know.

The program is compiled as MAKETAPE.EXE.  If you execute the program with no parameters it will display a message with the syntax it expects:

           INPUT: <input file name> | @<file containing file list>
           VOLSER: <1 to 6 character volume serial number>
           DATASET: <1 to 17 character dataset label>
           OUTPUT: <output file name>
           [ LRECL: <record length> ]
           [ BLOCK: <blocking factor> ]
           [ UNIQUE ]

The keywords for the parameters may be abbreviated to single characters (i, v, d, o, l, b, u).  The colon following the keyword may also be omitted.

There are four required keyword parameters - input, volser, dataset, and output

INPUT - specifies the source file to be read to create the data blocks.  This may specify a single file or a metafile; that is, a file containing the names of other files that will be read in sequence to build the input.  Preface the name with an at sign ('@') to designate a meta file.  The file should be created with a plain text editor, one file name per line, maximum of 50 lines (file names).  In the C version, I allow for 64 character file names, which should be adequate for most needs. 

VOLSER - specifies a one to six alphanumeric character volume serial number that will be written to the standard labels and used as the output dataset name.  My System 370 Job Control Language (Gary DeWard Brown, second edition) specifies that serial numbers less than six characters are right justified and padded with blanks in standard tape labels, so that is how I handle it here. 

DATASET - specifies a one to seventeen alphanumeric character dataset name.  This will be used to match to the DSN parameter on the DD card, so you need to make it conform to the naming conventions for MVT datasets.  I don't do any enforcement of this field; I only copy it over to the labels in the appropriate position.  (see related information in UNIQUE)

OUTPUT - specifies the output file which will contain the AWSTAPE image.

In the BASIC version, if the output file already exists with the same dataset name in the same subdirectory, you will be prompted to overwrite or abort:

AWSTAPE File: JAY009 appears to already exist. Do you want to overwrite (Y/N)?

Reply Y to overwrite the existing file or reply N to terminate the program.

There are three optional keyword parameters - lrecl, block, and unique.

LRECL - specifies the logical record size of both the input data record and the output data record.  Input records which are longer than the length specified here will be truncated to this length.  The default is 80.

BLOCK - specifies a blocking factor used to calculate the output block size (ie., the value of LRECL multiplied by the value of BLOCK yields the output BLKSIZE).  The default is 1 and I have established an arbitrary upper limit of 200.

Note that the LRECL and BLOCK parameters will apply to all files processed if the input file is a meta file rather than a single input file.

UNIQUE - can be used to indicate that each input file is to be placed in a separate output dataset on the AWSTAPE image.   The dataset name used for the output datasets will be modified by appending a low order qualifier consisting of the four digit file sequence number in order to ensure each dataset name on a tape volume is unique for MVT's use.  If the dataset name supplied when the program is executed is longer than twelve characters, the name supplied will be truncated to allow for the appending of the file sequence qualifier.  The default if UNIQUE is not specified is to aggregate all input files into a single output file on the AWSTAPE image. 

All parameters will be verified before any processing begins.  If the meta file or single input file is not present, the program will not run.  If there are more than fifty files in the meta file, any beyond fifty will be ignored.  Any individual files in the meta file that are not present are simply skipped, but if you specify a meta file and none of the files are present, the program will not make it past the parameter validation.

I have tried to be as accurate as possible building the VOL/HDR1/HDR2/EOF1/EOF2 label records.  I set the creation date to the day of year (commonly known as julian) format using the system date.  This may cause a problem if your system date is set correctly because the label fields are pre-Year-2000 and I don't have the century field available in the label.  I set the expiration date to 99365 which usually signifies non-expiring datasets.  The C date routines seem to not be adjusting for leap year correctly, so the day of year returned is off by one, at least under my environment (Caldera Open Linux).

As the input files are processed, messages are issued to indicate what files are processed and as  the trailing dataset label is written, the count of blocks written to the image file is displayed on the screen:

d:>maketape i @meta v jay506 d fmtmods.alc o jay506 b 20 unique
Processing input from: IFMTFILL.ALC 
Wrote 6  blocks to AWSTAPE file: JAY506 (File #0001 Dataset: FMTMODS.ALC.F0001)
Processing input from: IFMTFLPT.ALC 
Wrote 11  blocks to AWSTAPE file: JAY506 (File #0002 Dataset: FMTMODS.ALC.F0002)
Processing input from: IFMTHEX.ALC  
Wrote 8  blocks to AWSTAPE file: JAY506 (File #0003 Dataset: FMTMODS.ALC.F0003)
Processing input from: IFMTLJST.ALC 
Wrote 8  blocks to AWSTAPE file: JAY506 (File #0004 Dataset: FMTMODS.ALC.F0004)
Processing input from: IFMTMASK.ALC 
Wrote 9  blocks to AWSTAPE file: JAY506 (File #0005 Dataset: FMTMODS.ALC.F0005)
Processing input from: IFMTNIB.ALC  
Wrote 8  blocks to AWSTAPE file: JAY506 (File #0006 Dataset: FMTMODS.ALC.F0006)
Processing input from: OFMTHEX.ALC  
Wrote 7  blocks to AWSTAPE file: JAY506 (File #0007 Dataset: FMTMODS.ALC.F0007)
Processing input from: OFMTMONY.ALC 
Wrote 29  blocks to AWSTAPE file: JAY506 (File #0008 Dataset: FMTMODS.ALC.F0008)

The BASIC source and compiled executable is available for download here:  awsutilb.tar.gz.  The C source and compiled executable is available for download here:  awsutilc.tar.gz.

As I worked on MAKETAPE, I found it necessary to write a program that expanded upon Jay Maynard's tapemap program.  My TAPEDUMP program will provide a bit more summary information for the datasets found on an AWSTAPE image and will also allow the specification of a 'DETAIL' parameter to translate from EBCDIC and print the data records along with their associated AWS header information.

Like MAKETAPE, if you execute TAPEDUMP with no parameters, it will display the required syntax:

Syntax: TAPEDUMP  INPUT: | IN: | I: <input file name>
                  [ DETAIL | D ]

The default is summary mode, which results in the display of:

Processing AWSTAPE file: JAY501      
Serial Number from VOLume 1 label: JAY501
File  MVT Dataset       RECFM BLKSIZE LRECL BlocksExpected BlocksRead 
0001  FMTMODS.F0001       B       800    80             12         12 
0002  FMTMODS.F0002       B       800    80             22         22 
0003  FMTMODS.F0003       B       800    80             16         16 
0004  FMTMODS.F0004       B       800    80             15         15 
0005  FMTMODS.F0005       B       800    80             17         17 
0006  FMTMODS.F0006       B       800    80             16         16 
0007  FMTMODS.F0007       B       800    80             14         14 
0008  FMTMODS.F0008       B       800    80             57         57 

If you need to see the entire contents of the tape, include the DETAIL parameter to see output similar to:

Processing AWSTAPE file: JAY501      
Header: This:     80 Prev:      0 Flags: x'80'       x'20'      
Header: This:     80 Prev:     80 Flags: x'80'       x'20'      
HDR1FMTMODS.F0001    JAY50100010001       00255 993650000000                    
Header: This:     80 Prev:     80 Flags: x'80'       x'20'      
HDR2F008000008030EXTERNAL/EXTERNAL    B                                         
Header: This:      0 Prev:     80 Flags:       x'40'            
Header: This:    800 Prev:      0 Flags: x'80'       x'20'      
* ******************************************************************* *          
----- remainder of output not shown -----

Note:  As it is currently written, TAPEDUMP will only process tapes written with Standard Labels as it requires the information contained in the labels to deblock and process the data in individual records.

The sources and executable binaries for TAPEDUMP are included in the downloadable archives above.

I hope that if you use MAKETAPE, you find it beneficial.  If you have questions that I can answer or problems that I need to fix, please don't hesitate to let me know:

This information was obtained from Jay Moseley's WEB Site and reproduced with permission. 

The information on this site is the combined effort of a lot of people, please credit the authors if you use their information.
Please read the Disclaimer page for the restrictions, copyright, and other uses of the information contained on this site.
For problems or questions regarding this web contact Bob.
Last updated: September 04, 2001.