grant select permissions on created table

Posted on 2010-01-08
Last Modified: 2013-11-16

 I have created a table as follows:

libname A db2 database=D SCHEMA=B user=&userid password=&userpw;

proc sql;
BL_DATAFILE='/myfolder/test.dat',BL_OPTIONS='compound=7 norowwarnings')
as select *
 from X.T1;
grant select on A.MNTH  to user1,user2  <------want to accomplish this!!
Question by:LuckyLucks
    1 Comment
    LVL 9

    Accepted Solution

    You have to send that command to the database.  SAS will not process this command, obviously, that is why you are here. :-)

    Here is some code I have used to connect to a database and send the GRANT command.

        CONNECT TO DB2(USER="&Username" PASS="&Password" PATH="&Pathname");

        EXECUTE(GRANT SELECT ON A.MNTH TO user1,user2) BY DB2;


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Suggested Solutions

    Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
    Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now