BookmarkSubscribeRSS Feed
nycsummer
Calcite | Level 5

1.png

Here it is my data file.

And I run the following code

data work.final;

   infile temp1 missover;

   input date nasins $ @;

   count=0;

   do while (nasins ne ' ');

   count+1;

   output;

   input nasins $ @;

   end;

run;

proc print data=work.final;

run;

The log shows the following

870  data work.final;

871     infile temp1 missover;

872     input date nasins $ @;

873     count=0;

874     do while (nasins ne ' ');

875     count+1;

876     output;

877     input nasins $ @;

878     end;

879  run;

ERROR: No logical assign for filename TEMP1.

NOTE: The SAS System stopped processing this step because of errors.

WARNING: The data set WORK.FINAL may be incomplete.  When this step was stopped there were 0

         observations and 3 variables.

WARNING: Data set WORK.FINAL was not replaced because this step was stopped.

NOTE: DATA statement used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

880  proc print data=work.final;

881  run;

NOTE: No observations in data set WORK.FINAL.

NOTE: PROCEDURE PRINT used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

Can anyone provide some solutions?

Thans!

3 REPLIES 3
GraphGuy
Meteorite | Level 14

Here is one brute-force way to do what you're wanting...

 

data final (keep = date nasins);
input whole_line $ 1-80;
date=.; date=scan(whole_line,1,' ');
do i = 2 to countw(whole_line);
 nasins=scan(whole_line,i,' '); 
 output;
 end;
datalines;
1386036001 B002OO333Q B004M6XUI2 B006232JFS B00B1D03GQ B00CAKA062
1386036002 B00C6TZON6
1386036003 B001R4BT1M B00C43H85G B00DOSAMMQ B00EV207NS
;
run;

proc print data=final; 
run;
Reeza
Super User
Is that already a SAS data set or a text file your trying to read?
Tom
Super User Tom
Super User

Did you read the error message that you posted?

ERROR: No logical assign for filename TEMP1.

That means that there is no FILENAME statement defining what actual file TEMP1 is supposed to reference.

You can use either a libref or a quoted physical filename on the INFILE statement.

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 921 views
  • 0 likes
  • 4 in conversation