Help using Base SAS procedures

Getting Errors 22-322 and 201-322 using copy procedure

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

Getting Errors 22-322 and 201-322 using copy procedure

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;


Accepted Solutions
Solution
‎04-04-2015 06:11 PM
Super User
Posts: 19,832

Re: Getting Errors 22-322 and 201-322 using copy procedure

Posted in reply to DaveOrland

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


All Replies
Solution
‎04-04-2015 06:11 PM
Super User
Posts: 19,832

Re: Getting Errors 22-322 and 201-322 using copy procedure

Posted in reply to DaveOrland

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;

New Contributor
Posts: 2

Re: Getting Errors 22-322 and 201-322 using copy procedure

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

Super User
Posts: 19,832

Re: Getting Errors 22-322 and 201-322 using copy procedure

Posted in reply to DaveOrland

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;

🔒 This topic is solved and locked.

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

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