<?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 Translate one dataset to another using a custom metadata dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Translate-one-dataset-to-another-using-a-custom-metadata-dataset/m-p/584894#M166697</link>
    <description>&lt;P&gt;Hi, I am fairly new to SAS and have been using it for ETL purposes.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a source table, which I need to export to different people. Each time I need to output different columns and change the variable names, but the source table structure remains the same.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to do this by having static code and creating a metadata table in Excel, which I can change before I run the program each time and this tell SAS which variables to keep and what they are called..&amp;nbsp; Is this possible?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;E.g&lt;/STRONG&gt;&amp;nbsp; My Source Table:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#800080"&gt;&lt;STRONG&gt;S_Name&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#800080"&gt;&lt;STRONG&gt;S_ID&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#800080"&gt;&lt;STRONG&gt;S_Date&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#800080"&gt;&lt;STRONG&gt;S_Location&lt;/STR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RONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#008000"&gt;Name&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#800080"&gt;S_Name&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#008000"&gt;ID&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#800080"&gt;S_ID&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#008000"&gt;Region&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#800080"&gt;S_Region&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Desired Output:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#008000"&gt;&lt;STRONG&gt;Name&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#008000"&gt;&lt;STRONG&gt;ID&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#008000"&gt;&lt;STRONG&gt;Region&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Bill&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;EMEA&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Adam&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;EMEA&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Sean&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;EMEA&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Mary&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;4&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;APAC&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was playing around with loops and adding the new variables to the source table, then using the KEEP to store only what I need but can’t seem to get it just right.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any advice would be really appreciated.&amp;nbsp; Thanks.&lt;/P&gt;</description>
    <pubDate>Thu, 29 Aug 2019 11:46:18 GMT</pubDate>
    <dc:creator>Sha88</dc:creator>
    <dc:date>2019-08-29T11:46:18Z</dc:date>
    <item>
      <title>Translate one dataset to another using a custom metadata dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Translate-one-dataset-to-another-using-a-custom-metadata-dataset/m-p/584894#M166697</link>
      <description>&lt;P&gt;Hi, I am fairly new to SAS and have been using it for ETL purposes.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a source table, which I need to export to different people. Each time I need to output different columns and change the variable names, but the source table structure remains the same.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to do this by having static code and creating a metadata table in Excel, which I can change before I run the program each time and this tell SAS which variables to keep and what they are called..&amp;nbsp; Is this possible?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;E.g&lt;/STRONG&gt;&amp;nbsp; My Source Table:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#800080"&gt;&lt;STRONG&gt;S_Name&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#800080"&gt;&lt;STRONG&gt;S_ID&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#800080"&gt;&lt;STRONG&gt;S_Date&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#800080"&gt;&lt;STRONG&gt;S_Location&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#800080"&gt;&lt;STRONG&gt;S_Region&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#800080"&gt;&lt;STRONG&gt;S_Comments&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P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&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#008000"&gt;ID&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#800080"&gt;S_ID&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#008000"&gt;Region&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#800080"&gt;S_Region&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Desired Output:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#008000"&gt;&lt;STRONG&gt;Name&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#008000"&gt;&lt;STRONG&gt;ID&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#008000"&gt;&lt;STRONG&gt;Region&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Bill&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;EMEA&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Adam&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;EMEA&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Sean&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;EMEA&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Mary&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;4&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;APAC&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was playing around with loops and adding the new variables to the source table, then using the KEEP to store only what I need but can’t seem to get it just right.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any advice would be really appreciated.&amp;nbsp; Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2019 11:46:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Translate-one-dataset-to-another-using-a-custom-metadata-dataset/m-p/584894#M166697</guid>
      <dc:creator>Sha88</dc:creator>
      <dc:date>2019-08-29T11:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: Translate one dataset to another using a custom metadata dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Translate-one-dataset-to-another-using-a-custom-metadata-dataset/m-p/584897#M166699</link>
      <description>&lt;P&gt;You are having SOURCE as a SAS Data Set.&lt;/P&gt;
&lt;P&gt;Your metadata can be held as a macro var, say STR.&lt;/P&gt;
&lt;P&gt;%let STR = 'S_Name S_ID S_Region';&lt;/P&gt;
&lt;P&gt;Then Proc Print SOURCE with KEEP&amp;nbsp; = &amp;amp;STR statement.&lt;/P&gt;
&lt;P&gt;No need for Excel metadata.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2019 12:02:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Translate-one-dataset-to-another-using-a-custom-metadata-dataset/m-p/584897#M166699</guid>
      <dc:creator>KachiM</dc:creator>
      <dc:date>2019-08-29T12:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: Translate one dataset to another using a custom metadata dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Translate-one-dataset-to-another-using-a-custom-metadata-dataset/m-p/584898#M166700</link>
      <description>&lt;P&gt;Yes, this can be done, but i would not save the metadata in an excel file, but in a text-file, so that all variables have the expected type and length after reading it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please provide data in usable form: data-steps using datalines statements making it easier to work on solving the problem, instead of re-creating the necessary data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2019 12:06:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Translate-one-dataset-to-another-using-a-custom-metadata-dataset/m-p/584898#M166700</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-08-29T12:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: Translate one dataset to another using a custom metadata dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Translate-one-dataset-to-another-using-a-custom-metadata-dataset/m-p/584899#M166701</link>
      <description>&lt;P&gt;Hi,&amp;nbsp; I want to use Excel.&amp;nbsp; &amp;nbsp;So I can change the columns without changing code and the main priority is to have the variable names change in the output.&amp;nbsp; I need variable name to change from S_Name to Name for example.&amp;nbsp; &amp;nbsp; Then the next time it could be First_Name.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2019 12:12:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Translate-one-dataset-to-another-using-a-custom-metadata-dataset/m-p/584899#M166701</guid>
      <dc:creator>Sha88</dc:creator>
      <dc:date>2019-08-29T12:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: Translate one dataset to another using a custom metadata dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Translate-one-dataset-to-another-using-a-custom-metadata-dataset/m-p/584900#M166702</link>
      <description>&lt;P&gt;And another question: do you need the result as dataset or as report?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2019 12:18:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Translate-one-dataset-to-another-using-a-custom-metadata-dataset/m-p/584900#M166702</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-08-29T12:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: Translate one dataset to another using a custom metadata dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Translate-one-dataset-to-another-using-a-custom-metadata-dataset/m-p/584903#M166704</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data meta;
input (Variable	Order	Source)(:$32.);
cards;
Name	1	S_Name
ID	2	S_ID
Region	3	S_Region
;
data source;
input (S_Name 	S_ID	S_Date	S_Location	S_Region	S_Comments	S_Te) (&amp;amp; $32.);
cards;
Bill	1	1-Jan-19	UK	EMEA	None	 +44 20 999 999
Adam	2	1-Feb-19	UK	EMEA	Closing	 +44 20 999 998
Sean	3	1-Mar-19	ES	EMEA	Open	 +34 01 889 887
Mary	4	1-Apr-19	US	APAC	Open	 +1 555 9901
;
data _null_;
set meta end=z;
retain keep;
length keep $100;
keep=catx(' ',keep,variable);
if _n_=1 then call execute('data want;set source;');
call execute(catx('=',variable,source)||';');
if z then call execute(catx(' ','keep  ',keep,';','run;'));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Aug 2019 12:24:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Translate-one-dataset-to-another-using-a-custom-metadata-dataset/m-p/584903#M166704</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-08-29T12:24:23Z</dc:date>
    </item>
    <item>
      <title>Re: Translate one dataset to another using a custom metadata dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Translate-one-dataset-to-another-using-a-custom-metadata-dataset/m-p/584910#M166708</link>
      <description>&lt;P&gt;Here's an attempt - in some parts like the one already posted by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data _null_;
   set work.Metadata end=jobDone;

   length
      RetainList KeepList $ 350
      RenameList $ 700
   ;

   retain RetainList KeepList RenameList;

   RetainList = catx(' ', RetainList, Variable);
   KeepList = catx(' ', KeepList, Source);
   RenameList = catx(' ', RenameList, Source, '=', Variable);

   if jobDone then do;
      call execute('data target;');
      call execute(catx(' ', 'retain', RetainList, ';'));
      call execute(catx(' ', 'set Source(keep=', KeepList, 'rename=(', RenameList, '));'));
      call execute('run;');
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;i am still thinking about a way to skip reading/writing all observations. But i don't think this is possible at all, because of the requested re-ordering of variables.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2019 12:37:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Translate-one-dataset-to-another-using-a-custom-metadata-dataset/m-p/584910#M166708</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-08-29T12:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: Translate one dataset to another using a custom metadata dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Translate-one-dataset-to-another-using-a-custom-metadata-dataset/m-p/584936#M166716</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15475"&gt;@andreas_lds&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp; !!!! This is working perfectly with my code.&amp;nbsp; &amp;nbsp; Really appreciate you taking the time to help.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2019 14:00:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Translate-one-dataset-to-another-using-a-custom-metadata-dataset/m-p/584936#M166716</guid>
      <dc:creator>Sha88</dc:creator>
      <dc:date>2019-08-29T14:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: Translate one dataset to another using a custom metadata dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Translate-one-dataset-to-another-using-a-custom-metadata-dataset/m-p/584940#M166718</link>
      <description>&lt;P&gt;I don't want to ask too much, but do you think it would be possible to have variable length in the metadata table and have this set in the target?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2019 14:04:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Translate-one-dataset-to-another-using-a-custom-metadata-dataset/m-p/584940#M166718</guid>
      <dc:creator>Sha88</dc:creator>
      <dc:date>2019-08-29T14:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: Translate one dataset to another using a custom metadata dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Translate-one-dataset-to-another-using-a-custom-metadata-dataset/m-p/585133#M166815</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/234517"&gt;@Sha88&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I don't want to ask too much, but do you think it would be possible to have variable length in the metadata table and have this set in the target?&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;For alphanumeric variables only? That would make the whole process a lot more complex:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;a length-statement has be generated, probably replacing the retain statement&lt;/LI&gt;
&lt;LI&gt;you need to compare the metadata of source with the metadata table to decide if and what statement you have to generate for each variable.&lt;/LI&gt;
&lt;LI&gt;if the original value needs to be shortened, a call to substr is necessary.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe re-posting that question as new thread would be a good idea, because many people ignore already answered topics.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2019 04:29:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Translate-one-dataset-to-another-using-a-custom-metadata-dataset/m-p/585133#M166815</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-08-30T04:29:33Z</dc:date>
    </item>
  </channel>
</rss>

