<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Is there an option to prevent grant select on unknown user from stopping in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Is-there-an-option-to-prevent-grant-select-on-unknown-user-from/m-p/647509#M193807</link>
    <description>&lt;P&gt;Likely you need to show us how the macro variable &amp;amp;permlist is created.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are placing a name into that list that does not exist. So you need to revise the process that creates the list.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note: it is often not a good idea to have macro variables just appear in the body of your macro instead of passing them explicitly as a parameter as debugging can get pretty hard in some cases.&lt;/P&gt;</description>
    <pubDate>Wed, 13 May 2020 15:52:14 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-05-13T15:52:14Z</dc:date>
    <item>
      <title>Is there an option to prevent grant select on unknown user from stopping</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-an-option-to-prevent-grant-select-on-unknown-user-from/m-p/647505#M193805</link>
      <description>&lt;PRE&gt;1                                                          The SAS System                              10:30 Wednesday, May 13, 2020

NOTE: Unable to open SASUSER.PROFILE. WORK.PROFILE will be opened instead.
NOTE: All profile changes will be lost at the end of the session.
NOTE: Copyright (c) 2016 by SAS Institute Inc., Cary, NC, USA. 
NOTE: SAS (r) Proprietary Software 9.4 (TS1M6) 
      Licensed to FEDEX CIA SRVR -TRANSATIONAL LICENSE SUPPLEMENT 53, Site 70024850.
NOTE: This session is executing on the SunOS 5.10 (SUN 64) platform.



NOTE: Analytical products:
      
      SAS/STAT 15.1
      SAS/ETS 15.1
      SAS/OR 15.1
      SAS/IML 15.1
      SAS/QC 15.1

NOTE: Additional host information:

SUN SunOS SUN 64 5.10 Generic_150400-63 sun4v 

You are running SAS 9. Some SAS 8 files will be automatically converted 
by the V9 engine; others are incompatible.  Please see 
http://support.sas.com/rnd/migration/planning/platform/64bit.html

PROC MIGRATE will preserve current SAS file attributes and is 
recommended for converting all your SAS libraries from any 
SAS 8 release to SAS 9.  For details and examples, please see
http://support.sas.com/rnd/migration/index.html


This message is contained in the SAS news file, and is presented upon
initialization.  Edit the file "news" in the "misc/base" directory to
display site-specific news and information in the program log.
The command line option "-nonews" will prevent this display.




NOTE: SAS initialization used:
      real time           0.52 seconds
      cpu time            0.30 seconds
      
1          ******************************************************************************************;
2          options nocenter ps=max mlogic mprint;
3          ******************************************************************************************;
4          
5          ******************************************************************************************;
6          * MACRO DRIVER                                                                            ;
7          ******************************************************************************************;
8          %macro driver;
9          
10         
11            %inc "./common";
12         
13         
14            proc sql;
15               connect to teradata (user=&amp;amp;ish_user password=&amp;amp;prsauto_pwd tdpid='edwapps.prod.xxxx.com' connection=global);
16               %do i=1 %to %sysfunc(countw(&amp;amp;permlist,%str( )));
17                  %let name=%scan(&amp;amp;permlist,&amp;amp;i,%str( ));
18                  execute(grant select on prsauto_work_prod_db.jim_prcng_summary to &amp;amp;name) by teradata;
19                  execute(commit) by teradata;
20               %end;
21               disconnect from teradata;
22         
23         %mend;
24         ******************************************************************************************;
25         
26         
27         %driver;
MLOGIC(DRIVER):  Beginning execution.
MPRINT(DRIVER):   ******************************************************************************************;
MPRINT(DRIVER):   ******************************************************************************************;
MPRINT(DRIVER):   * Define the parameters describing the Teradata connection. ;
MPRINT(DRIVER):   ******************************************************************************************;
MPRINT(DRIVER):   ******************************************************************************************;
MPRINT(DRIVER):   proc sql;
MPRINT(DRIVER):   connect to teradata (user=prsauto password="xxxxxxxxxxxxxxxxxxxxx" tdpid='edwapps.prod.xxxxx.com' 
connection=global);
MLOGIC(DRIVER):  %DO loop beginning; index variable I; start value is 1; stop value is 8; by value is 1.  
MLOGIC(DRIVER):  %LET (variable name is NAME)
MPRINT(DRIVER):   execute(grant select on prsauto_work_prod_db.jim_prcng_summary to MD5030147) by teradata;
MPRINT(DRIVER):   execute(commit) by teradata;
MLOGIC(DRIVER):  %DO loop index variable I is now 2; loop will iterate again.
MLOGIC(DRIVER):  %LET (variable name is NAME)
MPRINT(DRIVER):   execute(grant select on prsauto_work_prod_db.jim_prcng_summary to KA580944) by teradata;
MPRINT(DRIVER):   execute(commit) by teradata;
MLOGIC(DRIVER):  %DO loop index variable I is now 3; loop will iterate again.
MLOGIC(DRIVER):  %LET (variable name is NAME)
MPRINT(DRIVER):   execute(grant select on prsauto_work_prod_db.jim_prcng_summary to PRSAUTO) by teradata;
MPRINT(DRIVER):   execute(commit) by teradata;
MLOGIC(DRIVER):  %DO loop index variable I is now 4; loop will iterate again.
MLOGIC(DRIVER):  %LET (variable name is NAME)
MPRINT(DRIVER):   execute(grant select on prsauto_work_prod_db.jim_prcng_summary to CG482286) by teradata;
MPRINT(DRIVER):   execute(commit) by teradata;
MLOGIC(DRIVER):  %DO loop index variable I is now 5; loop will iterate again.
MLOGIC(DRIVER):  %LET (variable name is NAME)
MPRINT(DRIVER):   execute(grant select on prsauto_work_prod_db.jim_prcng_summary to NN1234567) by teradata;
ERROR: Teradata execute: Database 'NN1234567' does not exist.
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
MPRINT(DRIVER):   execute(commit) by teradata;
NOTE: Statement not executed due to NOEXEC option.
MLOGIC(DRIVER):  %DO loop index variable I is now 6; loop will iterate again.
MLOGIC(DRIVER):  %LET (variable name is NAME)
MPRINT(DRIVER):   execute(grant select on prsauto_work_prod_db.jim_prcng_summary to KE436904) by teradata;
NOTE: Statement not executed due to NOEXEC option.
MPRINT(DRIVER):   execute(commit) by teradata;
NOTE: Statement not executed due to NOEXEC option.
MLOGIC(DRIVER):  %DO loop index variable I is now 7; loop will iterate again.
MLOGIC(DRIVER):  %LET (variable name is NAME)
MPRINT(DRIVER):   execute(grant select on prsauto_work_prod_db.jim_prcng_summary to KK5078688) by teradata;
NOTE: Statement not executed due to NOEXEC option.
MPRINT(DRIVER):   execute(commit) by teradata;
NOTE: Statement not executed due to NOEXEC option.
MLOGIC(DRIVER):  %DO loop index variable I is now 8; loop will iterate again.
MLOGIC(DRIVER):  %LET (variable name is NAME)
MPRINT(DRIVER):   execute(grant select on prsauto_work_prod_db.jim_prcng_summary to DT426854) by teradata;
NOTE: Statement not executed due to NOEXEC option.
MPRINT(DRIVER):   execute(commit) by teradata;
NOTE: Statement not executed due to NOEXEC option.
MLOGIC(DRIVER):  %DO loop index variable I is now 9; loop will not iterate again.
MPRINT(DRIVER):   disconnect from teradata;
NOTE: Statement not executed due to NOEXEC option.
MLOGIC(DRIVER):  Ending execution.
40         
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
      real time           5.28 seconds
      cpu time            0.36 seconds
      

ERROR: Errors printed on page 1.

NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414
NOTE: The SAS System used:
      real time           5.95 seconds
      cpu time            0.75 seconds
      
&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 May 2020 15:36:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-an-option-to-prevent-grant-select-on-unknown-user-from/m-p/647505#M193805</guid>
      <dc:creator>cellurl</dc:creator>
      <dc:date>2020-05-13T15:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an option to prevent grant select on unknown user from stopping</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-an-option-to-prevent-grant-select-on-unknown-user-from/m-p/647509#M193807</link>
      <description>&lt;P&gt;Likely you need to show us how the macro variable &amp;amp;permlist is created.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are placing a name into that list that does not exist. So you need to revise the process that creates the list.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note: it is often not a good idea to have macro variables just appear in the body of your macro instead of passing them explicitly as a parameter as debugging can get pretty hard in some cases.&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 15:52:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-an-option-to-prevent-grant-select-on-unknown-user-from/m-p/647509#M193807</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-05-13T15:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an option to prevent grant select on unknown user from stopping</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-an-option-to-prevent-grant-select-on-unknown-user-from/m-p/647524#M193810</link>
      <description>&lt;PRE&gt;%let permlist=  
               MD5030147 KA580944 PRSAUTO CG482286
               NN1234567 
               KE436904 KK5078688 DT426854;
&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 May 2020 16:23:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-an-option-to-prevent-grant-select-on-unknown-user-from/m-p/647524#M193810</guid>
      <dc:creator>cellurl</dc:creator>
      <dc:date>2020-05-13T16:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an option to prevent grant select on unknown user from stopping</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-an-option-to-prevent-grant-select-on-unknown-user-from/m-p/647526#M193811</link>
      <description>is there a noexec-continue, or trycatch or using syserr to continue?? I know having valid users is proper, but I want to see if I can fix this in sas as well.</description>
      <pubDate>Wed, 13 May 2020 16:24:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-an-option-to-prevent-grant-select-on-unknown-user-from/m-p/647526#M193811</guid>
      <dc:creator>cellurl</dc:creator>
      <dc:date>2020-05-13T16:24:46Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an option to prevent grant select on unknown user from stopping</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-an-option-to-prevent-grant-select-on-unknown-user-from/m-p/647539#M193815</link>
      <description>&lt;P&gt;Since you placed a value in a list, then what was the rule you used to add a non-existent file to the list?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Most DBMS systems have tools to get lists or create data sets with member, or properties of, data sets. (SAS Dictionary.tables for example) I would work with your Terradata DBA to get the syntax to build a set with the members you want (i.e. exist), read that data and use it to create the code you want. If you have the members you want in a data set it may be preferred to use that data with SAS call execute statement to create the calls you want.&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 17:15:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-an-option-to-prevent-grant-select-on-unknown-user-from/m-p/647539#M193815</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-05-13T17:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an option to prevent grant select on unknown user from stopping</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-an-option-to-prevent-grant-select-on-unknown-user-from/m-p/647553#M193818</link>
      <description>&lt;P&gt;I know my way around Oracle and DB2 pass-through and not really Terradata but I can imagine similar solutions work.&lt;/P&gt;
&lt;P&gt;Create a SAS ACCESS library that references the same Terradata schema.&lt;/P&gt;
&lt;P&gt;Then in your macro you can do something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if %sysfunc(exist(terralib.&amp;amp;table) %then %do;
    execute ( 
&amp;lt;Native terradata syntax that assumes &amp;amp;table exists&amp;gt;
) by terradata;
%end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or you can query the terradata data dictionary to determine the existence of the tables.&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;Querying database dictionary tables can generally only be done using pass-through,&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 17:39:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-an-option-to-prevent-grant-select-on-unknown-user-from/m-p/647553#M193818</guid>
      <dc:creator>DavePrinsloo</dc:creator>
      <dc:date>2020-05-13T17:39:50Z</dc:date>
    </item>
  </channel>
</rss>

