<?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: Importing Excel data and using the data for Masking data in dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/610903#M177992</link>
    <description>can you give a solution to do this</description>
    <pubDate>Wed, 11 Dec 2019 04:54:05 GMT</pubDate>
    <dc:creator>Kadz_sas1990</dc:creator>
    <dc:date>2019-12-11T04:54:05Z</dc:date>
    <item>
      <title>Importing Excel data and using the data for Masking data in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/610177#M177679</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I am having a code to mask the data in dataset while copying it to different location from source&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname FROM "source location";
libname TO "destination location";
proc format;
value $ cmask (default=12) other = 'ZZZZ';
value nmask (default=12) other = 'ZZZZ';
run;

proc datasets nolist lib=TO;
copy in=FROM out=TO memtype=data;
select dataset1 dataset2;
modify dataset1;
format column1 $cmask. column3 $cmask.;
modify dataset2;
format column3 $cmask. column5 $cmask.;
modify dataset3;
format phone_num $cmask. name $cmask. gender $cmask. dob nmask. mobile_no nmask. salary nmask.;
run;quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;here i need to give every dataset name,&amp;nbsp;column details&amp;nbsp;that need to be masked in the SAS code itself(program becomes bulky). instead of doing this can&amp;nbsp;I use excel sheet to my&amp;nbsp;code to refer the&amp;nbsp;dataset&amp;nbsp;name and sensitive columns to be masked. so one common code to copy any dataset from&amp;nbsp;one location to other. it should automatically refer the excel sheet i have and mask the required column while copying.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having Excel sheet like below, (Which can be edited according to needs)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="current.JPG" style="width: 281px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34540i76FC6E6C58E3AB49/image-size/large?v=v2&amp;amp;px=999" role="button" title="current.JPG" alt="current.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;here 1st column is the dataset name, 2nd column is the fields which&amp;nbsp;I need&amp;nbsp;to mask in the specified dataset and 3rd column is the type of the field(only two types of data I have in all datasets- Numeric and character).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so when iam copying the dataset from source to destination my code should refer this excel and it should check which dataset I am copying and correspondingly it should mask the fields(columns that listed as sensitive field in excel should be masked) and dataset should be copied after that to destination.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Dec 2019 06:16:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/610177#M177679</guid>
      <dc:creator>Kadz_sas1990</dc:creator>
      <dc:date>2019-12-07T06:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Excel data and using the data for Masking data in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/610180#M177680</link>
      <description>&lt;P&gt;Masking data with formats is not secure. Remove the formats and the original data will show. You need to replace the actual values. For character values the PUT function will do this. With numbers you could replace with 99999 or similar.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another option would be just to drop sensitive columns entirely. They aren't useful with rubbish data in them anyway.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Dec 2019 07:05:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/610180#M177680</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-12-07T07:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Excel data and using the data for Masking data in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/610606#M177831</link>
      <description>&lt;P&gt;I had imported the excel, I&amp;nbsp;got struck at creating macros. I imported my excel using below code&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC IMPORT OUT=WORK.sensitive
           DATAFILE="file location"
           DBMS=EXCEL REPLACE;
Proc print data=WORK.sensitive;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="current.JPG" style="width: 310px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34574i2C88098E09F7A825/image-size/large?v=v2&amp;amp;px=999" role="button" title="current.JPG" alt="current.JPG" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is how the dataset&amp;nbsp;WORK.sensitive looks like.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how to use this in macro to mask my required columns, can anyone help please..&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2019 04:49:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/610606#M177831</guid>
      <dc:creator>Kadz_sas1990</dc:creator>
      <dc:date>2019-12-10T04:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Excel data and using the data for Masking data in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/610609#M177834</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/301387"&gt;@Kadz_sas1990&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just applying a format is NOT data masking. The actual values are still in the table and not hard to extract.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;May be fully explain us what you need to do so we can give you some guidance on how you can get actual data masking.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also: Do you have the SAS Federation Server licensed?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To help you with coding (us providing actual code): Please post sample data in easy to use form (like via SAS data steps).&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2019 05:03:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/610609#M177834</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-12-10T05:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Excel data and using the data for Masking data in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/610652#M177859</link>
      <description>just format is enough in my case, kind of hiding.&lt;BR /&gt;yes my sas EG is licensed version. we are officially using it in our office legally.</description>
      <pubDate>Tue, 10 Dec 2019 10:05:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/610652#M177859</guid>
      <dc:creator>Kadz_sas1990</dc:creator>
      <dc:date>2019-12-10T10:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Excel data and using the data for Masking data in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/610653#M177860</link>
      <description>my complete thread is same sample of what I need. let me explain again. I have many datasets in one location in one server. my team mates will copy these datasets for there use(just for some testing purpose actually they wont use the some fields are values in it) what I am trying to do is creating a script which will copy the dataset from one loc to another while doing that my script should hide some columns or fields in the copying dataset.(this some customer sensitive info, they actually wont need it)</description>
      <pubDate>Tue, 10 Dec 2019 10:10:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/610653#M177860</guid>
      <dc:creator>Kadz_sas1990</dc:creator>
      <dc:date>2019-12-10T10:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Excel data and using the data for Masking data in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/610654#M177861</link>
      <description>I have collected all the sensitive fields or columns in all dataset and having it handy in a form of excel. my excel have 3 columns in it. 1st column is dataset name, 2nd column is sensitive fields that needs to be masked in that corresponding dataset, 3rd column is the type of the each sensitive field. so I need to use this excel sheet while copying the dataset so that corresponding fields should be hided or formatted while copying</description>
      <pubDate>Tue, 10 Dec 2019 10:15:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/610654#M177861</guid>
      <dc:creator>Kadz_sas1990</dc:creator>
      <dc:date>2019-12-10T10:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Excel data and using the data for Masking data in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/610675#M177871</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/301387"&gt;@Kadz_sas1990&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;my complete thread is same sample of what I need. let me explain again. I have many datasets in one location in one server. my team mates will copy these datasets for there use(just for some testing purpose actually they wont use the some fields are values in it) what I am trying to do is creating a script which will copy the dataset from one loc to another while doing that my script should hide some columns or fields in the copying dataset.(&lt;STRONG&gt;&lt;FONT color="#FF6600"&gt;this some customer sensitive info, they actually wont need it)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You don't plan to use a format to hide sensitive information, don't you?&lt;/P&gt;
&lt;P&gt;And if they don't need the variables, why wasting time to "hide" the contents? Dropping the variables requires less code and is faster.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2019 11:49:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/610675#M177871</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-12-10T11:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Excel data and using the data for Masking data in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/610854#M177970</link>
      <description>&lt;P&gt;Besides of anything else:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The custom format you create in your code gets stored in a catalog in your session specific WORK. You then want to assign this format permanently to some variables.&lt;/P&gt;
&lt;P&gt;The moment you're using such data in another SAS session where the formats don't exist you either get an error or if option NOFMTERR is set you'll see the unformatted values (these are your colleagues).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using EG: You can click on a cell in a table grid and select (switch to edit mode). Edit mode then also shows the unformatted values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So.... What you want to do is just a bad idea.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW: I've been asking if you've got the SAS Federation Server licensed (not EG). This is a SAS server module which allows you to mask data "on-the-fly".&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2019 22:02:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/610854#M177970</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-12-10T22:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Excel data and using the data for Masking data in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/610902#M177991</link>
      <description>does dropping the variable cause any changes in column details, I mean whether it impact dataset structure. I need some common values to filled in those columns that is my actual need. instead of format we can replace the values in those sensitive column. like IF &amp;amp;Var1 = variablename Then &lt;BR /&gt;if &amp;amp;type1 = "NUMERIC" then &lt;BR /&gt;variable =  9999&lt;BR /&gt;else if &amp;amp;type1 = "CHARACTER" then variable = "Test"||_n_;</description>
      <pubDate>Wed, 11 Dec 2019 04:52:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/610902#M177991</guid>
      <dc:creator>Kadz_sas1990</dc:creator>
      <dc:date>2019-12-11T04:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Excel data and using the data for Masking data in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/610903#M177992</link>
      <description>can you give a solution to do this</description>
      <pubDate>Wed, 11 Dec 2019 04:54:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/610903#M177992</guid>
      <dc:creator>Kadz_sas1990</dc:creator>
      <dc:date>2019-12-11T04:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Excel data and using the data for Masking data in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/610904#M177993</link>
      <description>SAS Federation Server licensed , I am not aware of this</description>
      <pubDate>Wed, 11 Dec 2019 04:59:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/610904#M177993</guid>
      <dc:creator>Kadz_sas1990</dc:creator>
      <dc:date>2019-12-11T04:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Excel data and using the data for Masking data in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/610906#M177994</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/301387"&gt;@Kadz_sas1990&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;does dropping the variable cause any changes in column details, I mean whether it impact dataset structure. I need some common values to filled in those columns that is my actual need. instead of format we can replace the values in those sensitive column. like IF &amp;amp;Var1 = variablename Then &lt;BR /&gt;if &amp;amp;type1 = "NUMERIC" then &lt;BR /&gt;variable = 9999&lt;BR /&gt;else if &amp;amp;type1 = "CHARACTER" then variable = "Test"||_n_;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Of course, if you drop a variable it is not in the dataset and no information is stored in the metadata-part of the dataset about the dropped variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You really should post one of your datasets and the control information (your excel file) as data steps using datalines-statement, so that we have something to work with.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 05:51:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/610906#M177994</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-12-11T05:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Excel data and using the data for Masking data in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/610914#M178000</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/301387"&gt;@Kadz_sas1990&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;can you give a solution to do this&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Ok, here you go. Please provide next time sample data in an easy to use form (=not as a screen shot, ideally as a SAS data step like done in the code below).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*data class;*/
/*  set sashelp.class;*/
/*run;*/

data excel;
  infile datalines dsd;
  input dsname :$41. colname :$32.;
  datalines;
class,sex
class,age
class,name
sashelp.air,air
;

/* list of all tables/cols that actually exist in a currently assigned library */
proc sql;
  create table colsToMask as
  select c.libname, c.memname, c.name, c.type, c.length as len
  from
    (  
      select
        upcase(scan(cats('WORK.',dsname),-2,'.')) as libname length=8,
        upcase(scan(dsname,-1,'.')) as memname length=32,
        upcase(colname) as name length=32
      from excel
    ) e
    ,
    dictionary.columns c
   where 
    e.libname=c.libname 
    and e.memname=c.memname 
    and e.name=upcase(c.name)
    and c.memtype='DATA'
  order by c.libname, c.memname
  ;
quit;

/* define library to store the tables with masked columns
   - do not overwrite the source tables
*/
%let outlib=out;
/*libname &amp;amp;outlib "%sysfunc(pathname(work))";*/
libname &amp;amp;outlib "&amp;lt;path name for output library";

/* generate code for masking */
filename codegen temp;
data _null_;
/*  file print;*/
  file codegen;
  set colsToMask;
  by libname memname;
  if first.memname then
    do;
      put 
        "data &amp;amp;outlib.." memname ';' /
        '  set ' libname +(-1) '.' memname ';'
        ;
    end;
  if type='num' then 
    put '  ' name '=9999;'; 
  else 
    do;
      _replace=repeat('Z',min(len-1,10));
      put 
        @3 name '="' _replace +(-1)'" ;' 
        ; 
    end;
  if last.memname then
    put 'run;' ;
run;

/* ensure that there is always a codegen file */
data _null_;
  file codegen mod;
run;

/* execute code for masking */
%include codegen / source2;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 07:55:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/610914#M178000</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-12-11T07:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Excel data and using the data for Masking data in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/612363#M178677</link>
      <description>what is the use of code gen file can you please explain your code.</description>
      <pubDate>Tue, 17 Dec 2019 11:55:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/612363#M178677</guid>
      <dc:creator>Kadz_sas1990</dc:creator>
      <dc:date>2019-12-17T11:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Excel data and using the data for Masking data in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/612364#M178678</link>
      <description>I tried the above code, there is no rows in coltomask table which created</description>
      <pubDate>Tue, 17 Dec 2019 11:57:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/612364#M178678</guid>
      <dc:creator>Kadz_sas1990</dc:creator>
      <dc:date>2019-12-17T11:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Excel data and using the data for Masking data in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/612572#M178780</link>
      <description>there is no results produced for this sql step&lt;BR /&gt;proc sql;&lt;BR /&gt;  create table colsToMask as&lt;BR /&gt;  select c.libname, c.memname, c.name, c.type, c.length as len&lt;BR /&gt;  from&lt;BR /&gt;    (  &lt;BR /&gt;      select&lt;BR /&gt;        upcase(scan(cats('WORK.',dsname),-2,'.')) as libname length=8,&lt;BR /&gt;        upcase(scan(dsname,-1,'.')) as memname length=32,&lt;BR /&gt;        upcase(colname) as name length=32&lt;BR /&gt;      from excel&lt;BR /&gt;    ) e&lt;BR /&gt;    ,&lt;BR /&gt;    dictionary.columns c&lt;BR /&gt;   where &lt;BR /&gt;    e.libname=c.libname &lt;BR /&gt;    and e.memname=c.memname &lt;BR /&gt;    and e.name=upcase(c.name)&lt;BR /&gt;    and c.memtype='DATA'&lt;BR /&gt;  order by c.libname, c.memname&lt;BR /&gt;  ;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;five columns are created like libname,memname,name,type,len&lt;BR /&gt;but no entries are there.. can you please check this?</description>
      <pubDate>Wed, 18 Dec 2019 04:19:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/612572#M178780</guid>
      <dc:creator>Kadz_sas1990</dc:creator>
      <dc:date>2019-12-18T04:19:41Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Excel data and using the data for Masking data in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/612846#M178912</link>
      <description>&lt;P&gt;You define the tables and columns to change here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data excel;
  infile datalines dsd;
  input dsname :$41. colname :$32.;
  datalines;
class,sex
class,age
class,name
sashelp.air,air
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Column DSNAME contains either &amp;lt;libref&amp;gt;.&amp;lt;table name&amp;gt; or &amp;lt;table name&amp;gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you only pass in &amp;lt;table name&amp;gt; then the code will use WORK as the libref&lt;/P&gt;
&lt;P&gt;Whatever you define here must actually exist (libref, table and column) without typo AND the library must be assigned. If it doesn't exist or the library is not assigned then the code won't fail but the SQL will not return any rows (as there was no match to what's in dictionary table dictionary.columns).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The SQL code and sample data for table EXCEL I've posted will pick-up SASHELP.AIR&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SASHELP.AIR is a SAS provided table that should exist in any SAS environment.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 431px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34945i141596D80000AE4E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If you also execute the data step at the beginning in comment then the SQL will also pick-up WORK.CLASS&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;"what is the use of code gen file can you please explain your code."&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;The data _null_ step generates code using PUT statements writing this code to a file in WORK.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;filename codegen temp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Keyword TEMP in the filename statement makes this a temporary file in WORK.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below statement then reads the generated code back into the SAS program so that it gets executed. The SOURCE2 option instructs SAS to write the %included code also to the SAS log.&lt;/P&gt;
&lt;PRE&gt;%include codegen / source2;&lt;/PRE&gt;
&lt;P&gt;With the code I've posted that's what you'll see in the SAS log.&lt;/P&gt;
&lt;PRE&gt;105        %include codegen / source2;
NOTE: %INCLUDE (level 1) file CODEGEN is file &amp;lt;path and filename&amp;gt;
106       +data out.AIR ;
107       +  set SASHELP.AIR ;
108       +  AIR =9999;
109       +run;&lt;/PRE&gt;
&lt;P&gt;And last but not least: You need to define a valid path for your environment to execute the code without error - or you use the libname definition in comment instead - but that's just for function testing and you shouldn't use it for your actual execution.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* define library to store the tables with masked columns
   - do not overwrite the source tables
*/
%let outlib=out;
/*libname &amp;amp;outlib "%sysfunc(pathname(work))";*/
libname &amp;amp;outlib "&amp;lt;path name for output library";&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 21:13:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/612846#M178912</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-12-18T21:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Excel data and using the data for Masking data in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/612934#M178941</link>
      <description>Brilliant Thanks a lot man.. working great.... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Thu, 19 Dec 2019 06:28:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/612934#M178941</guid>
      <dc:creator>Kadz_sas1990</dc:creator>
      <dc:date>2019-12-19T06:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Excel data and using the data for Masking data in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/612950#M178950</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&lt;BR /&gt;and also the code is copying all the datasets in library(excel sheet) to output path, but I need to copy any one or two of the datasets in excel sheet, how it can be done. just if I specify the name of the dataset it should copy to output path</description>
      <pubDate>Thu, 19 Dec 2019 08:52:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-Excel-data-and-using-the-data-for-Masking-data-in/m-p/612950#M178950</guid>
      <dc:creator>Kadz_sas1990</dc:creator>
      <dc:date>2019-12-19T08:52:38Z</dc:date>
    </item>
  </channel>
</rss>

