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.
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.
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.
@Fistful_Dollars wrote:
The docs show:
proc copy in=insource out=work; run;
My code looks fine in my opinion.
Thank you. So how do I copy an entire work/temp table into a new table in my permanent folder?
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.
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.
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.
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.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.