BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
DaveOrland
Calcite | Level 5

Hi.  I'm just starting out learning SAS Studio on SAS University Edition.  I'm trying to copy a table, sashelp.class, into a new file called work.classname.  When I run it, I get the errors below.  A new file called classname is created in my work folder but I can't open it because it doesn't contain any columns (I get an error message on it).  Any thoughts on how to correct this?  And is there an easier way to make a copy of an existing file?  Thanks.

data work.classname;

proc copy in=sashelp.class out=work.classname;

run;

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

42 ;

43 data work.classname;

NOTE: The data set WORK.CLASSNAME has 1 observations and 0 variables.

NOTE: DATA statement used (Total process time):

  real time 0.00 seconds

  cpu time 0.00 seconds

  

44 proc copy in=sashelp.class out=work.classname;

  _____________

  22

  201

ERROR 22-322: Expecting a name. 

ERROR 201-322: The option is not recognized and will be ignored.

45 run;

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

You only need part of the code above, either of the code below will create the classname file.

The first

data work.classname;

set sashelp.class;

run;

OR

proc copy in=sashelp.class out=work.classname;

run;

View solution in original post

3 REPLIES 3
Reeza
Super User

You only need part of the code above, either of the code below will create the classname file.

The first

data work.classname;

set sashelp.class;

run;

OR

proc copy in=sashelp.class out=work.classname;

run;

DaveOrland
Calcite | Level 5

Reeza,

Thanks so much for helping me out.

The first solution using the data and set statements works.

The second solution using copy still gives me the error statements.

Regardless, I only need one that works.

Thanks again!

- Dave

Reeza
Super User

Copy will copy from the libraries, the in/out should only have library names. I don't know if you can rename the file using proc copy though.

proc copy in=sashelp out=work;

select class;

run;quit;

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore 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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 3468 views
  • 0 likes
  • 2 in conversation