Help using Base SAS procedures

PROC COPY Not Working

Reply
Occasional Contributor
Posts: 13

PROC COPY Not Working

[ Edited ]

I run:

proc copy inlib=WORK.TABLE1 outlib=SAVEDREPORTS.TABLE1 ;
run;

I get these errors when I run the PROC COPY under the WORK.TABLE1 part of the code.

ERROR 22-322: Expecting a name.  
ERROR 201-322: The option is not recognized and will be ignored.
Super User
Posts: 23,776

Re: PROC COPY Not Working

Posted in reply to Fistful_Dollars

IN/OUT are to specify the library. The data set name is specified in the SELECT statement.

 

proc copy in=work out=random;
select myData;
run;

See the docs for usage examples if needed.

 


Fistful_Dollars wrote:

I run:

proc copy inlib=WORK.TABLE1 outlib=SAVEDREPORTS.TABLE1 ;
run;

I get these errors when I run the PROC COPY under the WORK.TABLE1 part of the code.

ERROR 22-322: Expecting a name.  
ERROR 201-322: The option is not recognized and will be ignored.

 

Occasional Contributor
Posts: 13

Re: PROC COPY Not Working

The docs show:

proc copy in=insource out=work;
run;

My code looks fine in my opinion.

Super User
Posts: 23,776

Re: PROC COPY Not Working

Posted in reply to Fistful_Dollars

The documentation, from your link, also specifies that they're LIBRARY names, not data set references as you've done. 

 

My code works.

 

1959  proc copy in=sashelp out=work;
1960  select class;
1961  run;

NOTE: Copying SASHELP.CLASS to WORK.CLASS (memtype=DATA).
NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: The data set WORK.CLASS has 19 observations and 5 variables.
NOTE: PROCEDURE COPY used (Total process time):
      real time           0.06 seconds
      cpu time            0.03 seconds


1962
1963  proc copy in=sashelp.class out=work.class;
                   -------------
                   22
                   201
ERROR 22-322: Expecting a name.
ERROR 201-322: The option is not recognized and will be ignored.
1964  run;

NOTE: Statements not processed because of errors noted above.
NOTE: PROCEDURE COPY used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds

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

 

delete_proc_copy.JPG


Fistful_Dollars wrote:

The docs show:

proc copy in=insource out=work;
run;

My code looks fine in my opinion.


 

Occasional Contributor
Posts: 13

Re: PROC COPY Not Working

Thank you.  So how do I copy an entire work/temp table into a new table in my permanent folder?

Super User
Posts: 23,776

Re: PROC COPY Not Working

Posted in reply to Fistful_Dollars

Please re-read my original response or run the code included in the example in my previous response.

 


Fistful_Dollars wrote:

Thank you.  So how do I copy an entire work/temp table into a new table in my permanent folder?


 

IN/OUT are to specify the library. The data set name is specified in the SELECT statement.

Occasional Contributor
Posts: 13

Re: PROC COPY Not Working

[ Edited ]

 

Thank you.  Now I get:

ERROR: The file WORK.TABLE1 (memtype=ALL) was not found, but appears on a SELECT statement.
ERROR: The file WORK.RUN (memtype=ALL) was not found, but appears on a SELECT statement.

Thank you for all your help.

Super User
Posts: 23,776

Re: PROC COPY Not Working

Posted in reply to Fistful_Dollars

Did you include the libname portions in the SELECT statement or just the data set names?


Fistful_Dollars wrote:

 

Thank you.  Now I get:

ERROR: The file WORK.TABLE1 (memtype=ALL) was not found, but appears on a SELECT statement.
ERROR: The file WORK.RUN (memtype=ALL) was not found, but appears on a SELECT statement.

Thank you for all your help.


 

Occasional Contributor
Posts: 13

Re: PROC COPY Not Working

Posted in reply to Fistful_Dollars

I think the error had to do with me copying the process flow to a new process flow.  So the original "work" data was in the other process flow or SAS though it was; so it couldn't find it.  Anyway, I just ended up redoing the queries to create permanent data sets.  Thank you everyone for your help.

Ask a Question
Discussion stats
  • 8 replies
  • 343 views
  • 5 likes
  • 2 in conversation