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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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