| Date: | Wed, 27 Sep 2000 06:56:53 +1000 |
| Reply-To: | Dougie <trigabyte@HOTMAIL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Dougie <trigabyte@HOTMAIL.COM> |
| Subject: | Re: HELP IN READING A FILE |
|---|
You code seemed to work fine using version 8.1 and reading in the data in a
datalines statement.
here is the code and the log:
1 DATA NAMES;
2 INPUT @1 ORANAME $18. @23 SASNAME $8. ;
3 datalines;
NOTE: The data set WORK.NAMES has 5 observations and 2 variables.
NOTE: DATA statement used:
real time 0.05 seconds
9 ;;;;
10 run;
11 proc print data=names noobs;
12 run;
NOTE: There were 5 observations read from the dataset WORK.NAMES.
NOTE: PROCEDURE PRINT used:
real time 0.05 seconds
and the output...it contained 5 obs and 2 variables - no missing values.
That may imply that your datafile is a bit on the nose rather than your SAS
code.
Cheers
Doug
<prasadp@my-deja.com> wrote in message news:8qj5t2$mib$1@nnrp1.deja.com...
> I am trying to read a file with only 2 variables in it, but somehow I
> am getting only some values read.
>
> I have a file with 2 varibales as shown:
>
> TD_ACCOMPLISHMENTS ACCOMP
> TD_CITIZENSHIP CITIZEN
> TD_EMERGENCY_CNTCT EMRGCONT
> TD_EMERGENCY_PHONE EMRGPHON
> TD_EMPLOYMENT EMPLOYMN
>
>
> Following is my log and output.
>
> 91 filename tables 'a:\FILE1.sas';
> 92 DATA NAMES;
> 93 INFILE TABLES END=EOF MISSOVER;
> 94 INPUT @1 ORANAME $18. @23 SASNAME $8. ;
> 95 RUN;
>
> NOTE: The infile TABLES is:
> File Name=a:\FILE1.sas,
> RECFM=V,LRECL=256
>
> NOTE: 5 records were read from the infile TABLES.
> The minimum record length was 28.
> The maximum record length was 30.
> NOTE: The data set WORK.NAMES has 5 observations and 2 variables.
> NOTE: DATA statement used:
> real time 0.06 seconds
>
>
> 96 PROC PRINT DATA = NAMES NOOBS;RUN;
>
> NOTE: PROCEDURE PRINT used:
> real time 0.04 seconds
>
>
> My output comes out as :
>
> ORANAME SASNAME
>
> TD_ACCOMPLISHMENTS
> TD_CITIZENSHIP
> TD_EMERGENCY_CNTCT EMRGCONT
> TD_EMERGENCY_PHONE EMRGPHON
> TD_EMPLOYMENT EMPLOYMN
>
>
> I am not getting any value in SASNAME for TD_ACCOMPLISHMENT and
> TD_CITIZENSHIP.
>
>
> I would appreciate if anybody can help me in reading this file. I tried
> using RECFM=F to change the file from Variable block to Fixed Block
> still it did not work.
>
>
> Thanks
>
> Prasad
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
|