DATA Step, Macro, Functions and more

Problem with import table

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

Problem with import table

I have a problem with a sample program as below:

 

title "Stock Inventory by Type";
data WORK.IMPORT1;
proc freq data=WORK.IMPORT1;
tables Sector / nocum;
run;
title;

 

IMPORT1 is a table imported with the "import" function, but when I lunch the program the system output:

 

"Impossible open the table "WORK.IMPORT1" because it doesn't contain columns.

 

If I go to the table I can see the data (6000 rows) but if I go to the "properties" - columns there are not columns displayed. Where is the problem (I'm novice with SAS, I'm using University Edition on Amazon AWS)? I understand is a problem in the importing procedure...

 

Thanks!

 


Accepted Solutions
Solution
‎10-23-2016 06:56 AM
Trusted Advisor
Posts: 1,553

Re: Problem with import table

Posted in reply to GianlucaS

Any data step ends either by RUN; or by a new data step or by PROC...;

 

your code:

title "Stock Inventory by Type";
data WORK.IMPORT1;      /* <<<< this line destroys your import and creates a table with no columns ! */
proc freq data=WORK.IMPORT1;
tables Sector / nocum;
run;
title;

 

View solution in original post


All Replies
Super User
Posts: 7,757

Re: Problem with import table

Posted in reply to GianlucaS

What do you mean by "go to the table"?

 

Run a

proc contents data=work.import1;
run;

and look at the output.

And run the import again and post the log (use the {i} icon to preserve formatting).

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Super User
Posts: 19,768

Re: Problem with import table

Posted in reply to GianlucaS

When you ran your import what was in the log 

Solution
‎10-23-2016 06:56 AM
Trusted Advisor
Posts: 1,553

Re: Problem with import table

Posted in reply to GianlucaS

Any data step ends either by RUN; or by a new data step or by PROC...;

 

your code:

title "Stock Inventory by Type";
data WORK.IMPORT1;      /* <<<< this line destroys your import and creates a table with no columns ! */
proc freq data=WORK.IMPORT1;
tables Sector / nocum;
run;
title;

 

Super User
Posts: 7,757

Re: Problem with import table

Good catch, @Shmuel!

 

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 281 views
  • 2 likes
  • 4 in conversation