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;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2047 views
  • 0 likes
  • 2 in conversation