<?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: Help to fill this column in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824295#M325522</link>
    <description>&lt;P&gt;Good morning&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/418326"&gt;@Renoux&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have understood why the code works. Pratically, I read a dataset where the column E_T99_X0010 doesn't exist.&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I would find a way to insert new values ( came out from a join) in a column altready existing in one step (I know that I can do this with two steps).&lt;BR /&gt;The following code is another new column to create but the scope is the same:&lt;BR /&gt;proc sql;&lt;BR /&gt;create table AG_E_DM_T031_INDOTHX_PROVA as&lt;BR /&gt;select a.*,&lt;BR /&gt;case when E_T031_C0010=E_DOMINIO then E_DESCRIZIONE&lt;BR /&gt;else E_T031_C0010 end as E_T031_X0010&lt;BR /&gt;from mis2dm.AG_E_DM_T031_INDOTHX a&lt;BR /&gt;left join DOMINI_LDR_FIX b&lt;BR /&gt;on a.E_PU_08910=b.E_PU_08910 and a.E_T031_C0010=b.E_DOMINIO ;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;this is the log&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;1          ;*';*";*/;quit;run;
2          OPTIONS PAGENO=MIN;
3          %LET _CLIENTTASKLABEL='Aggiunta campi con sigla X';
4          %LET _CLIENTPROCESSFLOWNAME='Flusso dei processi';
5          %LET _CLIENTPROJECTPATH='C:\Users\AntonioCiccaglione\Desktop\Iccrea\Implementazione colonne X e aggiunta descrizione.egp'
5        ! ;
6          %LET _CLIENTPROJECTPATHHOST='LAPTOP-5ML4ES7K';
7          %LET _CLIENTPROJECTNAME='Implementazione colonne X e aggiunta descrizione.egp';
8          %LET _SASPROGRAMFILE='';
9          %LET _SASPROGRAMFILEHOST='';
10         
11         ODS _ALL_ CLOSE;
12         OPTIONS DEV=SVG;
13         GOPTIONS XPIXELS=0 YPIXELS=0;
14         %macro HTML5AccessibleGraphSupported;
15             %if %_SAS_VERCOMP_FV(9,4,4, 0,0,0) &amp;gt;= 0 %then ACCESSIBLE_GRAPH;
16         %mend;
17         FILENAME EGHTML TEMP;
18         ODS HTML5(ID=EGHTML) FILE=EGHTML
19             OPTIONS(BITMAP_MODE='INLINE')
20             %HTML5AccessibleGraphSupported
21             ENCODING='utf-8'
22             STYLE=HtmlBlue
23             NOGTITLE
24             NOGFOOTNOTE
25             GPATH=&amp;amp;sasworklocation
26         ;
NOTE: Writing HTML5(EGHTML) Body file: EGHTML
27         
28         proc sql;
29         create table AG_E_DM_T031_INDOTHX_PROVA as
30         select a.*,
31         case when E_T031_C0010=E_DOMINIO then E_DESCRIZIONE
32         else E_T031_C0010 end as E_T031_X0010
33         from mis2dm.AG_E_DM_T031_INDOTHX  a
34         left join DOMINI_LDR_FIX  b
35         on a.E_PU_08910=b.E_PU_08910 and a.E_T031_C0010=b.E_DOMINIO ;
WARNING: Variable E_T031_X0010 already exists on file WORK.AG_E_DM_T031_INDOTHX_PROVA.
NOTE: Table WORK.AG_E_DM_T031_INDOTHX_PROVA created, with 34 rows and 59 columns.

36         quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.01 seconds
      user cpu time       0.02 seconds
      system cpu time     0.01 seconds
      memory              14998.01k
      OS Memory           34392.00k
      Timestamp           20/07/2022 07:32:52 m.
      Step Count                        13  Switch Count  2
      Page Faults                       0
      Page Reclaims                     1051
      Page Swaps                        0
      Voluntary Context Switches        139
      Involuntary Context Switches      5
      Block Input Operations            0
      Block Output Operations           2088
      &lt;/PRE&gt;&lt;P&gt;Question: is there a way to update a column already existing in a table through join?&lt;/P&gt;&lt;P&gt;Many Thanks&lt;/P&gt;</description>
    <pubDate>Wed, 20 Jul 2022 07:45:44 GMT</pubDate>
    <dc:creator>Anto180788</dc:creator>
    <dc:date>2022-07-20T07:45:44Z</dc:date>
    <item>
      <title>Help to fill this column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824106#M325417</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Anto180788_0-1658232387698.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/73491i576AF31C821CC795/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Anto180788_0-1658232387698.png" alt="Anto180788_0-1658232387698.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Good morning,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have problem. I need&amp;nbsp; to fill the column E_T99_X0010 with E_DESCRIZIONE when E_T99_C0010 = E_DOMINIO&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have written this sql code, but it doesn't work:&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table _3006_AG_E_DM_T099_INDOTHX_PROVA as&lt;BR /&gt;select a.* ,&lt;BR /&gt;case when a.E_T99_C0010=b.E_DOMINIO then b.E_DESCRIZIONE&lt;BR /&gt;else b.E_DESCRIZIONE end as E_T99_X0010&lt;BR /&gt;from mis2dm._3006_ag_e_dm_t099_indothx a&lt;BR /&gt;left join DOMINI_LDR_FIX b&lt;BR /&gt;on a.E_PU_08910=b.E_PU_08910 and a.E_T99_C0010=b.E_DOMINIO ;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 12:17:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824106#M325417</guid>
      <dc:creator>Anto180788</dc:creator>
      <dc:date>2022-07-19T12:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: Help to fill this column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824110#M325418</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Is this what you try to do ?&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;proc sql;

create table _3006_AG_E_DM_T099_INDOTHX_PROVA as
select a.* ,
b.E_DESCRIZIONE as E_T99_X0010
from mis2dm._3006_ag_e_dm_t099_indothx a
left join DOMINI_LDR_FIX b
on a.E_PU_08910=b.E_PU_08910 and a.E_T99_C0010=b.E_DOMINIO ;
quit;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 12:30:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824110#M325418</guid>
      <dc:creator>Renoux</dc:creator>
      <dc:date>2022-07-19T12:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: Help to fill this column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824111#M325419</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;case
  when a.E_T99_C0010=b.E_DOMINIO
  then b.E_DESCRIZIONE
  else b.E_DESCRIZIONE
end as E_T99_X0010&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Since you set it to E_DESCRIZIONE anyway in both branches, the CASE is not needed. Or you have a logic mistake here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS since you have the condition also in your ON clause, the CASE is not necessary at all.&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/418326"&gt;@Renoux&lt;/a&gt;&amp;nbsp;already shows you what to do.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 12:32:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824111#M325419</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-07-19T12:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help to fill this column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824113#M325420</link>
      <description>&lt;P&gt;Many thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/418326"&gt;@Renoux&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, it doesen't work either:&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="Anto180788_0-1658234741231.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/73493i4BEFBDD9B1590D6E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Anto180788_0-1658234741231.png" alt="Anto180788_0-1658234741231.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table _3006_AG_E_DM_T099_INDOTHX_PROVA as&lt;BR /&gt;select a.* ,b.E_DESCRIZIONE as E_T99_X0010&lt;BR /&gt;from mis2dm._3006_ag_e_dm_t099_indothx a&lt;BR /&gt;left join DOMINI_LDR_FIX b&lt;BR /&gt;on a.E_PU_08910=b.E_PU_08910 and a.E_T99_C0010=b.E_DOMINIO ;&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 12:46:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824113#M325420</guid>
      <dc:creator>Anto180788</dc:creator>
      <dc:date>2022-07-19T12:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: Help to fill this column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824120#M325423</link>
      <description>&lt;P&gt;Please supply example data for both tables in data steps with datalines; we can't test code with pictures.&lt;/P&gt;
&lt;P&gt;How the code works is simply demonstrated like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
input E_PU_08910 E_T99_C0010;
datalines;
1 1
2 2
3 3
;

data b;
input E_PU_08910 E_DOMINIO E_DESCRIZIONE $;
datalines;
1 1 X
2 1 X
3 3 X
;

proc sql;
create table want as
  select a.* ,b.E_DESCRIZIONE as E_T99_X0010
  from a left join b
  on a.E_PU_08910=b.E_PU_08910 and a.E_T99_C0010=b.E_DOMINIO
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Please explain where the result does not meet your expectations.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 12:56:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824120#M325423</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-07-19T12:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: Help to fill this column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824123#M325424</link>
      <description>Kurt,&lt;BR /&gt;For me it's ok. However, as the code copied here, I tried to run the code that &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/418326"&gt;@Renoux&lt;/a&gt; said, but SAS doesn't fill the column. i don't know why.&lt;BR /&gt;What I can say, The column E_T99_X0010 already exist in ._3006_ag_e_dm_t099_indothx where I added it through Alter Table step as CHR(250).</description>
      <pubDate>Tue, 19 Jul 2022 13:06:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824123#M325424</guid>
      <dc:creator>Anto180788</dc:creator>
      <dc:date>2022-07-19T13:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: Help to fill this column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824125#M325426</link>
      <description>&lt;P&gt;I should have requested this earlier:&lt;/P&gt;
&lt;P&gt;Please post your log; copy/paste it into a window opened with this button:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54552i914D97BE1B0F21E5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 13:10:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824125#M325426</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-07-19T13:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: Help to fill this column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824126#M325427</link>
      <description>&lt;PRE&gt;1          ;*';*";*/;quit;run;
2          OPTIONS PAGENO=MIN;
3          %LET _CLIENTTASKLABEL='Aggiunta campi con sigla X';
4          %LET _CLIENTPROCESSFLOWNAME='Flusso dei processi';
5          %LET _CLIENTPROJECTPATH='C:\Users\AntonioCiccaglione\Desktop\Iccrea\Implementazione colonne X e aggiunta descrizione.egp'
5        ! ;
6          %LET _CLIENTPROJECTPATHHOST='LAPTOP-5ML4ES7K';
7          %LET _CLIENTPROJECTNAME='Implementazione colonne X e aggiunta descrizione.egp';
8          %LET _SASPROGRAMFILE='';
9          %LET _SASPROGRAMFILEHOST='';
10         
11         ODS _ALL_ CLOSE;
12         OPTIONS DEV=SVG;
13         GOPTIONS XPIXELS=0 YPIXELS=0;
14         %macro HTML5AccessibleGraphSupported;
15             %if %_SAS_VERCOMP_FV(9,4,4, 0,0,0) &amp;gt;= 0 %then ACCESSIBLE_GRAPH;
16         %mend;
17         FILENAME EGHTML TEMP;
18         ODS HTML5(ID=EGHTML) FILE=EGHTML
19             OPTIONS(BITMAP_MODE='INLINE')
20             %HTML5AccessibleGraphSupported
21             ENCODING='utf-8'
22             STYLE=HtmlBlue
23             NOGTITLE
24             NOGFOOTNOTE
25             GPATH=&amp;amp;sasworklocation
26         ;
NOTE: Writing HTML5(EGHTML) Body file: EGHTML
27         
28         proc sql;
29         create table _3006_AG_E_DM_T099_INDOTHX_PROVA  as
30         select a.* ,b.E_DOMINIO,b.E_DESCRIZIONE as E_T99_X0010
31         from mis2dm._3006_ag_e_dm_t099_indothx  a
32         left join DOMINI_LDR_FIX  b
33         on a.E_PU_08910=b.E_PU_08910 and a.E_T99_C0010=b.E_DOMINIO ;
WARNING: Variable E_T99_X0010 already exists on file WORK._3006_AG_E_DM_T099_INDOTHX_PROVA.
NOTE: Table WORK._3006_AG_E_DM_T099_INDOTHX_PROVA created, with 13 rows and 11 columns.

34         quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.01 seconds
      user cpu time       0.02 seconds
      system cpu time     0.01 seconds
      memory              14559.31k
      OS Memory           36176.00k
      Timestamp           19/07/2022 01:18:28 p.
      Step Count                        87  Switch Count  2
      Page Faults                       0
      Page Reclaims                     940
      Page Swaps                        0
      Voluntary Context Switches        132
      Involuntary Context Switches      0
      Block Input Operations            0
      Block Output Operations           1952
      

35         
36         %LET _CLIENTTASKLABEL=;
2                                                          The SAS System                               08:06 Tuesday, July 19, 2022

37         %LET _CLIENTPROCESSFLOWNAME=;
38         %LET _CLIENTPROJECTPATH=;
39         %LET _CLIENTPROJECTPATHHOST=;
40         %LET _CLIENTPROJECTNAME=;
41         %LET _SASPROGRAMFILE=;
42         %LET _SASPROGRAMFILEHOST=;
43         
44         ;*';*";*/;quit;run;
45         ODS _ALL_ CLOSE;
46         
47         
48         QUIT; RUN;
49         &lt;/PRE&gt;&lt;P&gt;This is the log&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 13:22:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824126#M325427</guid>
      <dc:creator>Anto180788</dc:creator>
      <dc:date>2022-07-19T13:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help to fill this column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824132#M325429</link>
      <description>&lt;P&gt;This is your key:&lt;/P&gt;
&lt;PRE&gt;WARNING: Variable E_T99_X0010 already exists on file WORK._3006_AG_E_DM_T099_INDOTHX_PROVA.
&lt;/PRE&gt;
&lt;P&gt;Since the variable already exists, it prevents you from setting the values.&lt;/P&gt;
&lt;P&gt;Drop it:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;from mis2dm._3006_ag_e_dm_t099_indothx  (drop=E_T99_X0010) a&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or use a comprehensive list of variables from alias a instead of a.*&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 13:28:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824132#M325429</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-07-19T13:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: Help to fill this column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824140#M325434</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Reneaming the column could be a fast solution.&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I have one more requirement.&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="Anto180788_0-1658237874458.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/73501iC9A881F350CDD83D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Anto180788_0-1658237874458.png" alt="Anto180788_0-1658237874458.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to satisfy these conditions:&lt;/P&gt;&lt;P&gt;1) When&amp;nbsp;E_T99_C0010= E_Dominio then&amp;nbsp; E_T99_X0010=E_DESCRIZIONE (it is possibile reneaming the E_DESCRIZIONI)&lt;/P&gt;&lt;P&gt;2) In other cases&amp;nbsp; E_T99_X0010=E_T99_C0010&lt;/P&gt;&lt;P&gt;these are objectives.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Questions:&lt;/P&gt;&lt;P&gt;1) Case when statement is executes before or after join?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 13:54:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824140#M325434</guid>
      <dc:creator>Anto180788</dc:creator>
      <dc:date>2022-07-19T13:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: Help to fill this column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824141#M325435</link>
      <description>&lt;P&gt;Could you keep E_T99_C0010, E_Dominio and E_DESCRIZIONE in your proc sql?&lt;BR /&gt;Then you could run the following data step:&lt;/P&gt;&lt;PRE&gt;data _3006_AG_E_DM_T099_INDOTHX_PROVA;
set _3006_AG_E_DM_T099_INDOTHX_PROVA;
if (&lt;SPAN&gt;E_T99_C0010= E_Dominio) then&amp;nbsp; E_T99_X0010=E_DESCRIZIONE&lt;/SPAN&gt;;
else &lt;SPAN&gt;E_T99_X0010=E_T99_C0010&lt;/SPAN&gt;;&lt;BR /&gt;/*drop whatever_you_no_longer_need;*/ 
run;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Jul 2022 14:00:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824141#M325435</guid>
      <dc:creator>Renoux</dc:creator>
      <dc:date>2022-07-19T14:00:31Z</dc:date>
    </item>
    <item>
      <title>Re: Help to fill this column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824150#M325441</link>
      <description>I have already thought about data step.&lt;BR /&gt;I would try to do everything with one proc sql step.&lt;BR /&gt;May Update statement ca be more useful in this case?&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Jul 2022 14:24:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824150#M325441</guid>
      <dc:creator>Anto180788</dc:creator>
      <dc:date>2022-07-19T14:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: Help to fill this column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824159#M325444</link>
      <description>I resolved this issues :&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table _3006_AG_E_DM_T031_INDOTHX_PROVA as&lt;BR /&gt;select a.* ,&lt;BR /&gt;case when E_T99_C0010=E_DOMINIO then E_DESCRIZIONE&lt;BR /&gt;else E_T99_C0010 end as E_T99_X0010&lt;BR /&gt;from mis2dm._3006_AG_E_DM_T031_INDOTHX a&lt;BR /&gt;left join DOMINI_LDR_FIX b&lt;BR /&gt;on a.E_PU_08910=b.E_PU_08910 and a.E_T99_C0010=b.E_DOMINIO ;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;It works and It results the output expected&lt;BR /&gt;Many Thanks for all your help</description>
      <pubDate>Tue, 19 Jul 2022 14:50:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824159#M325444</guid>
      <dc:creator>Anto180788</dc:creator>
      <dc:date>2022-07-19T14:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: Help to fill this column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824160#M325445</link>
      <description>&lt;P&gt;I am fond of the COALESCEC (for character variable) and COALESCE (for numeric variable) functions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc sql;
create table _3006_AG_E_DM_T099_INDOTHX_PROVA as
select a.* ,
coalescec(b.E_DESCRIZIONE,c.E_T99_C0010)&amp;nbsp;format=$32. as E_T99_X0010
from mis2dm._3006_ag_e_dm_t099_indothx a
left join DOMINI_LDR_FIX b
on a.E_PU_08910=b.E_PU_08910 and a.E_T99_C0010=b.E_DOMINIO
left join DOMINI_LDR_FIX c
on a.E_PU_08910=c.E_PU_08910;
quit;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 14:50:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824160#M325445</guid>
      <dc:creator>Renoux</dc:creator>
      <dc:date>2022-07-19T14:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help to fill this column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824175#M325453</link>
      <description>&lt;P&gt;Many Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/418326"&gt;@Renoux&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 15:41:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824175#M325453</guid>
      <dc:creator>Anto180788</dc:creator>
      <dc:date>2022-07-19T15:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: Help to fill this column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824295#M325522</link>
      <description>&lt;P&gt;Good morning&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/418326"&gt;@Renoux&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have understood why the code works. Pratically, I read a dataset where the column E_T99_X0010 doesn't exist.&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I would find a way to insert new values ( came out from a join) in a column altready existing in one step (I know that I can do this with two steps).&lt;BR /&gt;The following code is another new column to create but the scope is the same:&lt;BR /&gt;proc sql;&lt;BR /&gt;create table AG_E_DM_T031_INDOTHX_PROVA as&lt;BR /&gt;select a.*,&lt;BR /&gt;case when E_T031_C0010=E_DOMINIO then E_DESCRIZIONE&lt;BR /&gt;else E_T031_C0010 end as E_T031_X0010&lt;BR /&gt;from mis2dm.AG_E_DM_T031_INDOTHX a&lt;BR /&gt;left join DOMINI_LDR_FIX b&lt;BR /&gt;on a.E_PU_08910=b.E_PU_08910 and a.E_T031_C0010=b.E_DOMINIO ;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;this is the log&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;1          ;*';*";*/;quit;run;
2          OPTIONS PAGENO=MIN;
3          %LET _CLIENTTASKLABEL='Aggiunta campi con sigla X';
4          %LET _CLIENTPROCESSFLOWNAME='Flusso dei processi';
5          %LET _CLIENTPROJECTPATH='C:\Users\AntonioCiccaglione\Desktop\Iccrea\Implementazione colonne X e aggiunta descrizione.egp'
5        ! ;
6          %LET _CLIENTPROJECTPATHHOST='LAPTOP-5ML4ES7K';
7          %LET _CLIENTPROJECTNAME='Implementazione colonne X e aggiunta descrizione.egp';
8          %LET _SASPROGRAMFILE='';
9          %LET _SASPROGRAMFILEHOST='';
10         
11         ODS _ALL_ CLOSE;
12         OPTIONS DEV=SVG;
13         GOPTIONS XPIXELS=0 YPIXELS=0;
14         %macro HTML5AccessibleGraphSupported;
15             %if %_SAS_VERCOMP_FV(9,4,4, 0,0,0) &amp;gt;= 0 %then ACCESSIBLE_GRAPH;
16         %mend;
17         FILENAME EGHTML TEMP;
18         ODS HTML5(ID=EGHTML) FILE=EGHTML
19             OPTIONS(BITMAP_MODE='INLINE')
20             %HTML5AccessibleGraphSupported
21             ENCODING='utf-8'
22             STYLE=HtmlBlue
23             NOGTITLE
24             NOGFOOTNOTE
25             GPATH=&amp;amp;sasworklocation
26         ;
NOTE: Writing HTML5(EGHTML) Body file: EGHTML
27         
28         proc sql;
29         create table AG_E_DM_T031_INDOTHX_PROVA as
30         select a.*,
31         case when E_T031_C0010=E_DOMINIO then E_DESCRIZIONE
32         else E_T031_C0010 end as E_T031_X0010
33         from mis2dm.AG_E_DM_T031_INDOTHX  a
34         left join DOMINI_LDR_FIX  b
35         on a.E_PU_08910=b.E_PU_08910 and a.E_T031_C0010=b.E_DOMINIO ;
WARNING: Variable E_T031_X0010 already exists on file WORK.AG_E_DM_T031_INDOTHX_PROVA.
NOTE: Table WORK.AG_E_DM_T031_INDOTHX_PROVA created, with 34 rows and 59 columns.

36         quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.01 seconds
      user cpu time       0.02 seconds
      system cpu time     0.01 seconds
      memory              14998.01k
      OS Memory           34392.00k
      Timestamp           20/07/2022 07:32:52 m.
      Step Count                        13  Switch Count  2
      Page Faults                       0
      Page Reclaims                     1051
      Page Swaps                        0
      Voluntary Context Switches        139
      Involuntary Context Switches      5
      Block Input Operations            0
      Block Output Operations           2088
      &lt;/PRE&gt;&lt;P&gt;Question: is there a way to update a column already existing in a table through join?&lt;/P&gt;&lt;P&gt;Many Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2022 07:45:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824295#M325522</guid>
      <dc:creator>Anto180788</dc:creator>
      <dc:date>2022-07-20T07:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: Help to fill this column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824304#M325524</link>
      <description>&lt;P&gt;I see I have to repeat myself.&lt;/P&gt;
&lt;P&gt;Do NOT (as in&amp;nbsp;&lt;FONT size="5"&gt;&lt;U&gt;&lt;STRONG&gt;NOT&lt;/STRONG&gt;&lt;/U&gt;&lt;/FONT&gt;) use the asterisk. The asterisk includes the existing variable and prevents the creation of a new one with the same name.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do this instead:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table AG_E_DM_T031_INDOTHX_PROVA as
  select
    /* list of all variables except E_T031_X0010 */
    ,coalesce(b.E_DESCRIZIONE,a.E_T031_C0010) as E_T031_X0010
  from mis2dm.AG_E_DM_T031_INDOTHX a
  left join DOMINI_LDR_FIX b
  on a.E_PU_08910 = b.E_PU_08910 and a.E_T031_C0010 = b.E_DOMINIO
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The second part of the ON clause makes the CASE unnecessary, but you still must make sure that the original value prevails if no match is found, therefore the COALESCE function. If no match is found,&amp;nbsp;&lt;SPAN&gt;E_DESCRIZIONE is missing and the original value is kept.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Big hint for the future: refrain from using the asterisk. Only use it if you do not create any new variables, or can be positively sure that the new variable(s) do not exist already.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2022 09:05:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824304#M325524</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-07-20T09:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Help to fill this column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824308#M325526</link>
      <description>Good morning Kurt,&lt;BR /&gt;thank you for your helping explanation.&lt;BR /&gt;I will keep in mind your advice.&lt;BR /&gt;The reason of this problem is that I have a database in my company.&lt;BR /&gt;They said me that I have to do these solutions through updating existing columns (which are added through alter table step).&lt;BR /&gt;So, the problem is how I can update these.&lt;BR /&gt;&lt;BR /&gt;Many thanks</description>
      <pubDate>Wed, 20 Jul 2022 09:19:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-to-fill-this-column/m-p/824308#M325526</guid>
      <dc:creator>Anto180788</dc:creator>
      <dc:date>2022-07-20T09:19:57Z</dc:date>
    </item>
  </channel>
</rss>

