X-Delivery-Notice: SMTP MAIL FROM does not correspond to sender.
Newsgroups: bit.listserv.sas-l
Date:         Thu, 5 Nov 1992 13:39:24 GMT
Reply-To:     "Simon Watson" <SJW1@IBM-B.RUTHERFORD.AC.UK>
From:         "Simon Watson" <SJW1@IBM-B.RUTHERFORD.AC.UK>
Subject:      Reading binary data

This may be a simple problem but anyway...

I am trying to read a binary file from tape into a SAS dataset using
SAS 6.07 on VM/ESA and CMS.
The tape file is RECFM VBS and BLKSIZE 23476. I can read the data with a
FORTRAN program with no problem, but there seems to be a problem with my
SAS code. It seems that the record length is being 'truncated' as seen by
the SAS program so that it has to 'wrap around' onto the next record
before reading all of the previous record:
11                                                          The SAS System

 NOTE: Copyright(c) 1989 by SAS Institute Inc., Cary, NC USA.
 NOTE: SAS (r) Proprietary Software Release 6.07  TS301
       Licensed to Rutherford Appleton Laboratory, Site 0004007001.

 NOTE: Running on IBM Model 3090 Serial Number 541890.


 1          libname cmdata 'h';
 NOTE: Libref CMDATA was successfully assigned as follows:
       Engine:        V607
       Physical Name: CMDATA   H1
 2          DATA cmdata.WIND;
 3              INFILE INDATA;
 4              INPUT (X1-X17 t1-t15 txg1-txg15 tyg1-tyg15 d1-d12 dxg1-dxg12
 5                     dyg1-dyg12 u1-u15 v1-v15 div1-div15 curl1-curl15
 6                     u v) (160*RB4.);
 7              drop x1-x8  x17;
 8              flag=1;
 9              ARRAY STEPDATA
 10                    X9-X16 t1-t15 txg1-txg15 tyg1-tyg15 d1-d12 dxg1-dxg12
 11                    dyg1-dyg12 u1-u15 v1-v15 div1-div15 curl1-curl15
 12                    u v;
 13             DO OVER STEPDATA;
 14               IF STEPDATA < -3000. THEN STEPDATA=.;
 15               END;

 NOTE: The infile INDATA is:
       Filename=TAP1,
       Recfm=VBS,Lrecl=260,Blksize=23476,
       Max data length=256

 ERROR: File CMDATA.WIND.DATA is damaged. I/O processing did not complete.
+ERROR: File CMDATA.WIND.DATA is damaged. I/O processing did not complete.
+ERROR: File CMDATA.WIND.DATA is damaged. I/O processing did not complete.
 ERROR: Write to CMDATA.WIND.DATA failed. File is full and may be damaged.
+ERROR: Write to CMDATA.WIND.DATA failed. File is full and may be damaged.
+ERROR: Write to CMDATA.WIND.DATA failed. File is full and may be damaged.
 NOTE: 6195 records were read from the infile INDATA.
       The minimum record length was 256.
       The maximum record length was 256.
       One or more lines were truncated.
 NOTE: SAS went to a new line when INPUT statement reached past the end of a lin
 NOTE: The SAS System stopped processing this step because of errors.
 NOTE: SAS set option OBS=0 and will continue to check statements. This may caus
 WARNING: The data set CMDATA.WIND may be incomplete.  When this step was stoppe
 WARNING: Data set CMDATA.WIND was not replaced because this step was stopped.
 etc.

I have read binary data OK in the past (up to 83 variables per record) with
SAS so I just wonder whether this is a tape problem or maybe too many variables
for the INPUT statement? (is there a limit to the number of variables you can
read in with one INPUT statement?)

Any help would be very much appreciated. Thanks

    Simon Watson.
Newsgroups: bit.listserv.sas-l