<?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: Data set and merge table refuse new column in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-set-and-merge-table-refuse-new-column/m-p/412300#M26501</link>
    <description>&lt;P&gt;I have correct the C by a letter D .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the problem appear here :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;if a way="transac_way1";
if b way="transac_way2";
if c way="transac_way3";
if d way="transac_way4";&lt;/PRE&gt;&lt;P&gt;The word "way" for each line here is considered like an error by SAS. SAS say that an operator symbol is missing or that it's necessary to use an other.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Nov 2017 12:50:26 GMT</pubDate>
    <dc:creator>azertyuiop</dc:creator>
    <dc:date>2017-11-10T12:50:26Z</dc:date>
    <item>
      <title>Data set and merge table refuse new column</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-set-and-merge-table-refuse-new-column/m-p/412272#M26488</link>
      <description>&lt;P&gt;Hello ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I must merge 4 tables in SAS without using proc sql and union. I must usge DATA and SET.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data quatre_fichiers;
 
set work.bd1_imp 

/*additional column*/ way='transac_way1'
(rename=("N°"n=num
Application=app  
"Nature transac"n=lbnat 
"Cause transac"n=lbcau
"Anomalie(s)"n=anomalie  
"Date rejet "n=dtrej 
Acteur=lbact 
Statut=lbsta 
"Analyse srv1"n=anasrv1  
"Analyse srv2"n=ana 
"Date correction"n=dtcorr
initiale=trigramme));

set work.bd2_imp 

/*additional column*/ way='transac_way2'
(rename=("N°"n=num
Application=app  
"Nature transac"n=lbnat 
"Cause transac"n=lbcau
"Anomalie(s)"n=anomalie  
"Date rejet "n=dtrej 
Acteur=lbact 
Statut=lbsta 
"Analyse srv1"n=anasrv1  
"Analyse srv2"n=ana 
"Date correction"n=dtcorr
initiale=trigramme));

set work.bd3_imp 

/*additional column*/ way='transac_way3'
(rename=("N°"n=num
Application=app  
"Nature transac"n=lbnat 
"Cause transac"n=lbcau
"Anomalie(s)"n=anomalie  
"Date rejet "n=dtrej 
Acteur=lbact 
Statut=lbsta 
"Analyse srv1"n=anasrv1  
"Analyse srv2"n=ana 
"Date correction"n=dtcorr
initiale=trigramme));

set work.bd4_imp 

/*additional column*/ way='transac_way4'
(rename=("N°"n=num
Application=app  
"Nature transac"n=lbnat 
"Cause transac"n=lbcau
"Anomalie(s)"n=anomalie  
"Date rejet "n=dtrej 
Acteur=lbact 
Statut=lbsta 
"Analyse srv1"n=anasrv1  
"Analyse srv2"n=ana 
"Date correction"n=dtcorr
initiale=trigramme));
 
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sas refuse to insert the new column in first position in my new table (this new column is " way " ). This column must contain a special value in function of the table which is insert . If the data come from the table work.bd1,&amp;nbsp; I want see 'transac_way1' in the new column which is own the name ' way '&amp;nbsp; , if it's work.bd2 I want 'transac_way2'&amp;nbsp; .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this case SAS refuse to read the instruction way='value' . It's the event case if I place instruction attrib or label .&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2017 11:09:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-set-and-merge-table-refuse-new-column/m-p/412272#M26488</guid>
      <dc:creator>azertyuiop</dc:creator>
      <dc:date>2017-11-10T11:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: Data set and merge table refuse new column</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-set-and-merge-table-refuse-new-column/m-p/412276#M26491</link>
      <description>&lt;P&gt;Sorry, your question isn't clear.&amp;nbsp; If you just want the variable way to appear as the first variable in the dataset, then you need to initialise it before reading the other data, something simple like:&lt;/P&gt;
&lt;PRE&gt;data want;
  length way $100;
  set...;
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Nov 2017 11:24:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-set-and-merge-table-refuse-new-column/m-p/412276#M26491</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-11-10T11:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: Data set and merge table refuse new column</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-set-and-merge-table-refuse-new-column/m-p/412278#M26492</link>
      <description>&lt;P&gt;Hello ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I add your instruction it's always the same problem . Sas Doesn't want add the column with the value ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data quatre_fichiers;

length way $100;

set work.bd1_imp

/*additional column*/ way='transac_way1'
(rename=("N°"n=num
Application=app  
"Nature transac"n=lbnat
"Cause transac"n=lbcau
"Anomalie(s)"n=anomalie  
"Date rejet "n=dtrej
Acteur=lbact
Statut=lbsta
"Analyse srv1"n=anasrv1  
"Analyse srv2"n=ana
"Date correction"n=dtcorr
initiale=trigramme));

set work.bd2_imp

/*additional column*/ way='transac_way2'
(rename=("N°"n=num
Application=app  
"Nature transac"n=lbnat
"Cause transac"n=lbcau
"Anomalie(s)"n=anomalie  
"Date rejet "n=dtrej
Acteur=lbact
Statut=lbsta
"Analyse srv1"n=anasrv1  
"Analyse srv2"n=ana
"Date correction"n=dtcorr
initiale=trigramme));

set work.bd3_imp

/*additional column*/ way='transac_way3'
(rename=("N°"n=num
Application=app  
"Nature transac"n=lbnat
"Cause transac"n=lbcau
"Anomalie(s)"n=anomalie  
"Date rejet "n=dtrej
Acteur=lbact
Statut=lbsta
"Analyse srv1"n=anasrv1  
"Analyse srv2"n=ana
"Date correction"n=dtcorr
initiale=trigramme));

set work.bd4_imp

/*additional column*/ way='transac_way4'
(rename=("N°"n=num
Application=app  
"Nature transac"n=lbnat
"Cause transac"n=lbcau
"Anomalie(s)"n=anomalie  
"Date rejet "n=dtrej
Acteur=lbact
Statut=lbsta
"Analyse srv1"n=anasrv1  
"Analyse srv2"n=ana
"Date correction"n=dtcorr
initiale=trigramme));
 
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Nov 2017 11:40:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-set-and-merge-table-refuse-new-column/m-p/412278#M26492</guid>
      <dc:creator>azertyuiop</dc:creator>
      <dc:date>2017-11-10T11:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: Data set and merge table refuse new column</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-set-and-merge-table-refuse-new-column/m-p/412281#M26493</link>
      <description>&lt;P&gt;So you have 4 tables of identical structure, that need to be concatenated (merge doesn't make sense, you would lose three quarters of the data because of identical variable names).&lt;/P&gt;
&lt;P&gt;And you want to have a flag that holds a pointer to where the data came from.&lt;/P&gt;
&lt;P&gt;Do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data quatre_fichiers;
length way $32; /* puts way in first position */
set
  work.bd1_imp
  work.bd2_imp
  work.bd3_imp
  work.bd4_imp
  indsname=inds
;
rename
  "N°"n=num
  Application=app  
  "Nature transac"n=lbnat 
  "Cause transac"n=lbcau
  "Anomalie(s)"n=anomalie  
  "Date rejet "n=dtrej 
  Acteur=lbact 
  Statut=lbsta 
  "Analyse srv1"n=anasrv1  
  "Analyse srv2"n=ana 
  "Date correction"n=dtcorr
  initiale=trigramme
;
way = inds;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2017 12:07:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-set-and-merge-table-refuse-new-column/m-p/412281#M26493</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-11-10T12:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: Data set and merge table refuse new column</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-set-and-merge-table-refuse-new-column/m-p/412284#M26495</link>
      <description>&lt;P&gt;You get errors as your code isn't valid:&lt;/P&gt;
&lt;PRE&gt;set work.bd1_imp

/*additional column*/ way='transac_way1'&lt;/PRE&gt;
&lt;P&gt;You do not assign data to values in a set statment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyways, it appears&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;has given you code which is far more succinct, so use that, although I would make a slight change so that it matches your way= text:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data quatre_fichiers;
length way $32; /* puts way in first position */
set
  work.bd1_imp (in=a)
  work.bd2_imp (in=b)
  work.bd3_imp (in=c)
  work.bd4_imp (in=c)
;
rename
  "N°"n=num
  Application=app  
  "Nature transac"n=lbnat 
  "Cause transac"n=lbcau
  "Anomalie(s)"n=anomalie  
  "Date rejet "n=dtrej 
  Acteur=lbact 
  Statut=lbsta 
  "Analyse srv1"n=anasrv1  
  "Analyse srv2"n=ana 
  "Date correction"n=dtcorr
  initiale=trigramme
;
if a way="transac_way1";
if b way="transac_way2";
if c way="transac_way3";
if d way="transac_way4";
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Nov 2017 12:18:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-set-and-merge-table-refuse-new-column/m-p/412284#M26495</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-11-10T12:18:45Z</dc:date>
    </item>
    <item>
      <title>Re: Data set and merge table refuse new column</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-set-and-merge-table-refuse-new-column/m-p/412286#M26496</link>
      <description>&lt;P&gt;Hello ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;@ &lt;SPAN class="UserName lia-user-name lia-user-rank-Super-User"&gt;&lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562" target="_self"&gt;&lt;SPAN class="login-bold"&gt;KurtBremser&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I confirm , I can now see the name and source of table in the column "way".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's a excellent new &lt;img id="manhappy" class="emoticon emoticon-manhappy" src="https://communities.sas.com/i/smilies/16x16_man-happy.png" alt="Man Happy" title="Man Happy" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I confirm , your solution too . It's an other system for me if I must use a specifical value.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2017 12:25:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-set-and-merge-table-refuse-new-column/m-p/412286#M26496</guid>
      <dc:creator>azertyuiop</dc:creator>
      <dc:date>2017-11-10T12:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Data set and merge table refuse new column</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-set-and-merge-table-refuse-new-column/m-p/412293#M26497</link>
      <description>&lt;P&gt;When I process this instruction " if d way="transac_way4"; "&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS refuse to execute the code and can't affect the value in " way " field .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is this message&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;amp;, (, *, **, +, -, /, ;, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;&amp;lt;, &amp;gt;=, AND, EQ, GE, 
              GT, IN, LE, LT, MAX, MIN, NE, NG, NL, NOTIN, OR, [, ^=, {, |, ||, ~=.  &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data quatre_fichiers;
length way $32; /* puts way in first position */
set
  work.bd1_imp (in=a)
  work.bd2_imp (in=b)
  work.bd3_imp (in=c)
  work.bd4_imp (in=c)
;
rename
  "N°"n=num
  Application=app  
  "Nature transac"n=lbnat 
  "Cause transac"n=lbcau
  "Anomalie(s)"n=anomalie  
  "Date rejet "n=dtrej 
  Acteur=lbact 
  Statut=lbsta 
  "Analyse srv1"n=anasrv1  
  "Analyse srv2"n=ana 
  "Date correction"n=dtcorr
  initiale=trigramme
;
if a way="transac_way1";
if b way="transac_way2";
if c way="transac_way3";
if d way="transac_way4";
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2017 12:40:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-set-and-merge-table-refuse-new-column/m-p/412293#M26497</guid>
      <dc:creator>azertyuiop</dc:creator>
      <dc:date>2017-11-10T12:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: Data set and merge table refuse new column</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-set-and-merge-table-refuse-new-column/m-p/412294#M26498</link>
      <description>&lt;P&gt;That's because of a typo in&lt;/P&gt;
&lt;PRE&gt;work.bd4_imp (in=c)&lt;/PRE&gt;
&lt;P&gt;it should be&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;work.bd4_imp (in=d)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Look at the log. You'll find a message&lt;/P&gt;
&lt;PRE&gt;NOTE: variable d is unitialized.&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Nov 2017 12:43:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-set-and-merge-table-refuse-new-column/m-p/412294#M26498</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-11-10T12:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: Data set and merge table refuse new column</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-set-and-merge-table-refuse-new-column/m-p/412299#M26500</link>
      <description>&lt;P&gt;Now, if you would use in1 to in4 for your in= variables (instead of a to d), you now get a structure that lends itself very well to automating repeated code with a macro, so that you could combine an arbitrary set of similarly named datasets by specifiying just one number.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2017 12:49:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-set-and-merge-table-refuse-new-column/m-p/412299#M26500</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-11-10T12:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: Data set and merge table refuse new column</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-set-and-merge-table-refuse-new-column/m-p/412300#M26501</link>
      <description>&lt;P&gt;I have correct the C by a letter D .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the problem appear here :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;if a way="transac_way1";
if b way="transac_way2";
if c way="transac_way3";
if d way="transac_way4";&lt;/PRE&gt;&lt;P&gt;The word "way" for each line here is considered like an error by SAS. SAS say that an operator symbol is missing or that it's necessary to use an other.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2017 12:50:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-set-and-merge-table-refuse-new-column/m-p/412300#M26501</guid>
      <dc:creator>azertyuiop</dc:creator>
      <dc:date>2017-11-10T12:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Data set and merge table refuse new column</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-set-and-merge-table-refuse-new-column/m-p/412303#M26502</link>
      <description>&lt;P&gt;Look up the documentation of the IF data step statement, and you will immediately be able to fix &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;'s mistake.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2017 12:56:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-set-and-merge-table-refuse-new-column/m-p/412303#M26502</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-11-10T12:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: Data set and merge table refuse new column</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-set-and-merge-table-refuse-new-column/m-p/412310#M26503</link>
      <description>&lt;P&gt;Missing "then":&lt;/P&gt;
&lt;PRE&gt;if a then way="abc";&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Nov 2017 13:07:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-set-and-merge-table-refuse-new-column/m-p/412310#M26503</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-11-10T13:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: Data set and merge table refuse new column</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-set-and-merge-table-refuse-new-column/m-p/412311#M26504</link>
      <description>&lt;P&gt;I have found the correction.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Element "then" in the instruction is missing. I have add this element .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000202239.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000202239.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2017 13:07:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-set-and-merge-table-refuse-new-column/m-p/412311#M26504</guid>
      <dc:creator>azertyuiop</dc:creator>
      <dc:date>2017-11-10T13:07:46Z</dc:date>
    </item>
  </channel>
</rss>

