From: BLEBLANC@UMIAMIVM.BITNET
Newsgroups: bit.listserv.sas-l
Subject: truncover
Date: 16 Oct 92 12:50:46 GMT
Reply-To: BLEBLANC@UMIAMIVM.BITNET
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU

----------------------------------------------------------------------
CONTENT:  truncover option in infile statement
SUMMARY:  short records with column input need truncover too
REL/PLTF: 6.07, CMS 8 /ESA 1.1, IBM9021
E-ADDR:   BLEBLANC@UMIAMIVM.BITNET
NAME:     Bill LeBlanc
PH/ADDR:  305/284-3915  U of Miami PO Box 248011 Coral Gables FL 33124
----------------------------------------------------------------------

Several references have been made lately to the 6.07 TRUNCOVER option
described in Tech Report P-222.  I'd like to point out that the example
in the book, although specifically referring to list input, also applies
to column input.  The following program illustrates what happens when
the last data value in any line of a variable-length file is not right
justified.  The MISSOVER option keeps SAS from going to a new line, but
doesn't cause that last value to be 'grabbed'.  The PAD option is another
alternative.  If used, the LRECL option should accompany it (as I didn't
do.)  TRUNCOVER applies also if the data are in-stream, and your program
file is variable-length.

Bill LeBlanc
Academic Support Group
University of Miami
PO Box 248011
Coral Gables, FL 33124
305-284-3915
BITNET:   BLEBLANC@UMIAMIVM
INTERNET: BLEBLANC@UMIAMIVM.IR.MIAMI.EDU
--------------------------------------------------------------------
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 UNIVERSITY OF MIAMI, Site 0002516003.

 NOTE: Running on IBM Model 9021 Serial Number 013579.


  WELCOME TO THE SAS SYSTEM, RELEASE 6.07.

    PC SAS News Announcement: A new device driver for for the
      HP Deskjet 500C color printer is available.  Call 284-3915.



 NOTE: AUTOEXEC processing beginning; file is SASEXEC  SAS      A1.


 NOTE: AUTOEXEC processing completed.

 1          CMS FILEDEF IN DISK TESTDAT DATA A
 1                                            ;
 2
 3          /* THE DATA FILE (LRECL=80, RECFM=V) LOOKS LIKE THIS:
 4          1 2 3  4
 5          5 6 7 8
 6          9 8 7  6
 7          6 5 4 3      */
 8
 9           DATA NOTHING;
 10            INFILE IN;
 11              INPUT A 1-2
 12                    B 3-4
 13                    C 5-6
 14                    D 7-8;
 15

 NOTE: The infile IN is:
       Filename=TESTDAT DATA A1,
       Recfm=V,Lrecl=260,Blksize=264,
       Max data length=256

 NOTE: LOST CARD.
 A=6 B=5 C=4 D=. _ERROR_=1 _N_=3
 NOTE: 4 records were read from the infile IN.
       The minimum record length was 7.
       The maximum record length was 8.
 NOTE: SAS went to a new line when INPUT statement reached past the end of a lin
 NOTE: The data set WORK.NOTHING has 2 observations and 4 variables.

 16             PROC PRINT;
 17             TITLE1 'USING NO INFILE OPTION';
 18         *---------------------------------------------;

 NOTE: The PROCEDURE PRINT printed page 1.

 19          DATA TRUNCOVR;
 20            INFILE IN TRUNCOVER;
 21              INPUT A 1-2
 22                    B 3-4
 23                    C 5-6
 24                    D 7-8;
 25

 NOTE: The infile IN is:
       Filename=TESTDAT DATA A1,
       Recfm=V,Lrecl=260,Blksize=264,
       Max data length=256

 NOTE: 4 records were read from the infile IN.
       The minimum record length was 7.
       The maximum record length was 8.
 NOTE: The data set WORK.TRUNCOVR has 4 observations and 4 variables.

 26             PROC PRINT;
 27             TITLE1 'USING TRUNCOVER OPTION';
 28         *---------------------------------------------;
 29

 NOTE: The PROCEDURE PRINT printed page 2.

 30          DATA MISSOVER;
 31            INFILE IN MISSOVER;
 32              INPUT A 1-2
 33                    B 3-4
 34                    C 5-6
 35                    D 7-8;
 36

 NOTE: The infile IN is:
       Filename=TESTDAT DATA A1,
       Recfm=V,Lrecl=260,Blksize=264,
       Max data length=256

 NOTE: 4 records were read from the infile IN.
       The minimum record length was 7.
       The maximum record length was 8.
 NOTE: The data set WORK.MISSOVER has 4 observations and 4 variables.

 37             PROC PRINT;
 38             TITLE1 'USING MISSOVER OPTION';
 39         *---------------------------------------------;
 40

 NOTE: The PROCEDURE PRINT printed page 3.

 41          DATA PAD;
 42            INFILE IN PAD;
 43              INPUT A 1-2
 44                    B 3-4
 45                    C 5-6
 46                    D 7-8;
 47

 NOTE: The infile IN is:
       Filename=TESTDAT DATA A1,
       Recfm=V,Lrecl=260,Blksize=264,

       Max data length=256

 NOTE: 4 records were read from the infile IN.
       The minimum record length was 7.
       The maximum record length was 8.
 NOTE: The data set WORK.PAD has 4 observations and 4 variables.

 48             PROC PRINT;
 49             TITLE1 'USING PAD OPTION';
 NOTE: The PROCEDURE PRINT printed page 4.

 NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414

1USING NO INFILE OPTION

 OBS    A    B    C    D

  1     1    2    3    4
  2     5    6    7    9

1USING TRUNCOVER OPTION

 OBS    A    B    C    D

  1     1    2    3    4
  2     5    6    7    8
  3     9    8    7    6
  4     6    5    4    3

1USING MISSOVER OPTION

 OBS    A    B    C    D

  1     1    2    3    4
  2     5    6    7    .
  3     9    8    7    6
  4     6    5    4    .

1USING PAD OPTION

 OBS    A    B    C    D

  1     1    2    3    4
  2     5    6    7    8
  3     9    8    7    6
  4     6    5    4    3