Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tape File Processing

Status
Not open for further replies.

Joelama

Programmer
Joined
May 15, 2000
Messages
1
Location
US
Help please...<br><br>I have a Microfocus cobol program running on Unix.<br><br>I'm trying to read an IBM tape file lrecl=128, blocksize=32460. The program only sees the first 4 records of each block (512k worth). Organization is line sequential gets the first 4 records of each block. Organization is record sequential only gets the first record of each block.&nbsp;&nbsp;<br><br>I've tried Block contains 255 records and Block contains 32460 characters. <br><br>Any ideas on what I need to set to get at the additional records. <br><br>I've used the dd command on Unix to copy down the whole tape and that works but I really want to get at the tape file directly from the program. <br><br>Thanks in advance<br>Joe Lama
 
I noticed that your blksize (32460) is not an exact multiple of your lrecl (128). That may be a contributing factor. Then again maybe your file contains variable length recs.&nbsp;&nbsp;
 
Part of this problem may be hardware related.&nbsp;&nbsp;Something has to terminate the read.&nbsp;&nbsp;Normally with a definition of <br>&quot;LINE SEQUENTIAL&quot; in MicroFocus the system will read the file until the number of characters defined in the &quot;01 LEVEL&quot; is reached.&nbsp;&nbsp;If a Carriage return/Line feed combo is encountered the read will terminate either with the correct number of characters in the record or shorted.&nbsp;&nbsp;<br><br>&quot;RECORD SEQUENTIAL&quot; expects to pick up the number of characters in the &quot;01 LEVEL&quot; and consider the record complete; regardless of terminators.<br><br>Normally a read will be terminated by number of chars read, CR/LF or the inter-record gap on the tape.&nbsp;&nbsp;I wonder if you are not getting an inter-record gap read termination.
 
Sorry, I transposed some numbers, the block size is really 32640, I typed it wrong here.&nbsp;&nbsp;<br><br>Here is how I actually got around it, I piped the DD command into the external file name: Here is the code:<br><br>DD_ID1FILE='&lt; dd if=/dev/rmt/c13t0d0s0ny ibs=32640'<br>export DD_ID1FILE<br><br>DD_OD1FILE=/home1/jlamatti/devdir/data/tape000201.dat<br>export DD_OD1FILE<br><br>cobrun /home1/jlamatti/devdir/src/COPY128 <br><br><br>In the cobol program itself I had the following.<br><br>SPECIAL-NAMES.<br>&nbsp;&nbsp;&nbsp;&nbsp;CHARXSET IS EBCDIC.<br><br><br>SELECT INPUT-FILE<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ASSIGN TO EXTERNAL&nbsp;&nbsp;ID1FILE<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ORGANIZATION LINE SEQUENTIAL.<br><br>*********************************************************<br>** INPUT FILE - 128 CHARACTERS LONG&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;**<br>*********************************************************<br>&nbsp;FD&nbsp;&nbsp;INPUT-FILE<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BLOCK CONTAINS 0&nbsp;&nbsp;&nbsp;RECORDS<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RECORD CONTAINS 128 CHARACTERS<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CODE-SET IS CHARXSET<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LABEL RECORDS ARE STANDARD<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RECORDING MODE IS FIXED<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DATA RECORD IS INPUT-RECORD.<br><br>&nbsp;01&nbsp;&nbsp;INPUT-RECORD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PIC X(128).<br><br><br>The above code allowed the program to read all 236,624 records and converted the data from EBCDIC to ASCII.&nbsp;&nbsp;<br><br><br>Joe <br><br><br><br><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top