BookmarkSubscribeRSS Feed
Fistful_Dollars
Obsidian | Level 7

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.
8 REPLIES 8
Reeza
Super User

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.

 

Fistful_Dollars
Obsidian | Level 7

The docs show:

proc copy in=insource out=work;
run;

My code looks fine in my opinion.

Reeza
Super User

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.


 

Fistful_Dollars
Obsidian | Level 7

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

Reeza
Super User

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.

Fistful_Dollars
Obsidian | Level 7

 

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.

Reeza
Super User

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.


 

Fistful_Dollars
Obsidian | Level 7

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.

SAS Innovate 2025: Register Now

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!

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
  • 8 replies
  • 3696 views
  • 5 likes
  • 2 in conversation