Learning SAS? Welcome to the exclusive online community for all SAS learners.

ERROR 22-7: Invalid option name PROC.

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

ERROR 22-7: Invalid option name PROC.

Hi,all, I access the xlsx file using the method

I have set the shared folders and make the spelling correct. BTW, my xlsx is very simple. My code is following,

libname perm 'folders/myfolders'

proc import datafile="folders/myfolders/small_example.xlsx"

OUT=perm.data1

DBMS=xlsx replace;

run;

However, the log is shown :

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

42 ;

43 libname perm 'folders/myfolders'

44 proc import datafile="folders/myfolders/small_example.xlsx"

  ____

  22

ERROR 22-7: Invalid option name PROC.

44 ! proc import datafile="folders/myfolders/small_example.xlsx"

  ________

  22

ERROR 22-7: Invalid option name DATAFILE.

45 OUT=perm.data1

  ___

  22

ERROR 22-7: Invalid option name OUT.

46 DBMS=xlsx replace;

  ____

  22

ERROR: Libref PERM is not assigned.

ERROR: Error in the LIBNAME statement.

ERROR 22-7: Invalid option name DBMS.

47 run;

48 ;

49 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

59 ;

I don't know how to fix this problem.  appreciate to receive your solutions.


Accepted Solutions
Solution
‎11-27-2014 09:40 PM
Super User
Super User
Posts: 7,039

Re: ERROR 22-7: Invalid option name PROC.

If you write the paths that way without the root (/) at the beginning then they are treated as relative to the current directory.

libname xxx '/folders/....' ;

View solution in original post


All Replies
Trusted Advisor
Posts: 1,137

Re: ERROR 22-7: Invalid option name PROC.

I believe after the libname statement, the semicolon is missing . Please update and execute the code. Hope it will fix the issue.

libname perm 'folders/myfolders';

Thanks,

Jag

Thanks,
Jag
New Contributor
Posts: 3

Re: ERROR 22-7: Invalid option name PROC.

Posted in reply to Jagadishkatam

Thanks. However, I still have other problems and have to say The University Edition is difficult to use

question.png

Yesterday I used the same code, It showed "The libname Mywork2 was successfully assigned". Today it shows "Library MYWORK2 does not exist.". (In the left library, i can see it clearly)

The message " Physical file does not exist," is always there. What a headache problem.

Solution
‎11-27-2014 09:40 PM
Super User
Super User
Posts: 7,039

Re: ERROR 22-7: Invalid option name PROC.

If you write the paths that way without the root (/) at the beginning then they are treated as relative to the current directory.

libname xxx '/folders/....' ;

New Contributor
Posts: 3

Re: ERROR 22-7: Invalid option name PROC.

It does work. Thanks

SAS Employee
Posts: 20

Re: ERROR 22-7: Invalid option name PROC.

Jag is right regarding the missing semicolon. Also have a look at the information given by Cynthia@sas in this post https://communities.sas.com/message/218581#218581 . The post provides clear examples and additional information that may be useful.

Cheers, Jos

🔒 This topic is solved and locked.

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

Discussion stats
  • 5 replies
  • 2275 views
  • 1 like
  • 4 in conversation