<?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: Correct Entries in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Correct-Entries/m-p/672408#M202090</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4061"&gt;@twildone&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;The posted Department1 for StudentUID=86518 is MAA. When I ran your code, I am getting both MAA and MOA for this same StudentUID.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What is the meaning of the new variable?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your words make it sound like you want the student's department to drive the remapping.&amp;nbsp; But your input does not have a student level department variable.&amp;nbsp; The existing data just have the one department variable the observation level.&amp;nbsp; Most of your students have more than one department listed.&amp;nbsp; How do you want to pick the department for the remapping?&lt;/P&gt;
&lt;PRE&gt;      Student   Academic
Obs     UID       Year      dept1   dept2   dept3   dept4   dept5   dept6   dept7   dept8   dept9   dept10

 1     83136    2017-2018    CAR     CAR     CT     YB       YB      YBC     CAR
 2     83882    2018-2019    MOA     MOA     RH     RH       RH      MOA     MOA     MOA     ES       ES
 3     86518    2019-2020    RH      RH      MAA    MAA      MAA     ES      ES
 4     86519    2019-2020    IB      IB      IB     LM       LM      IB
 5     88069    2017-2018    NCT     NCT     ES     CDCA
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 26 Jul 2020 18:45:24 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2020-07-26T18:45:24Z</dc:date>
    <item>
      <title>Correct Entries</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correct-Entries/m-p/672338#M202046</link>
      <description>&lt;P&gt;Hi...I am trying to change certain Department entries. Each record represents a course and courses may be taken from different departments. In order to identify the program that the student is enrolled in, I need to group the courses for each student to the appropiate Department which will identify the program of study. Because some courses are not counted or used as credit toward the students program, I have to identify which Department entries that are to be changed. From the code below that I have so far, the changes are being made. Any suggestion or revision would be greatly appreciated.Thanks.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data Have;
    length 'Academic Year'n $ 9 StudentUID 8 Department $ 4;
    format 'Academic Year'n $char9. StudentUID best12. Department $char4.;
    informat 'Academic Year'n $char9. StudentUID best12. Department $char4.;
    infile datalines4 dlm='7f'x missover dsd;
    input 'Academic Year'n : $char9. StudentUID : best32. Department : $char4.;
datalines4;
2017-2018&amp;#127; 83136&amp;#127; CAR
2017-2018&amp;#127; 83136&amp;#127; CAR
2017-2018 &amp;#127;83136 &amp;#127;CT
2017-2018&amp;#127; 83136&amp;#127; YB
2017-2018&amp;#127; 83136&amp;#127; YB
2017-2018&amp;#127; 83136 &amp;#127;YBC
2017-2018&amp;#127; 83136 &amp;#127;CAR
2017-2018&amp;#127; 88069&amp;#127; NCT
2017-2018 &amp;#127;88069 &amp;#127;NCT
2017-2018&amp;#127; 88069 &amp;#127;ES
2017-2018&amp;#127; 88069&amp;#127; CDCA
2018-2019&amp;#127; 83882 &amp;#127;MOA
2018-2019&amp;#127; 83882 &amp;#127;MOA
2018-2019&amp;#127; 83882&amp;#127; RH
2018-2019 &amp;#127;83882 &amp;#127;RH
2018-2019 &amp;#127;83882 &amp;#127;RH
2018-2019&amp;#127; 83882&amp;#127; MOA
2018-2019&amp;#127; 83882&amp;#127; MOA
2018-2019&amp;#127; 83882&amp;#127; MOA
2018-2019 &amp;#127;83882&amp;#127; ES
2018-2019&amp;#127; 83882 &amp;#127;ES
2019-2020&amp;#127; 86518 RH
2019-2020 &amp;#127;86518 &amp;#127;RH
2019-2020&amp;#127; 86518&amp;#127; MAA
2019-2020&amp;#127; 86518 MAA
2019-2020&amp;#127; 86518 &amp;#127;MAA
2019-2020&amp;#127; 86518 &amp;#127;ES
2019-2020&amp;#127; 86518 &amp;#127;ES
2019-2020&amp;#127; 86519&amp;#127; IB
2019-2020&amp;#127; 86519 &amp;#127;IB
2019-2020&amp;#127; 86519&amp;#127; IB
2019-2020&amp;#127; 86519&amp;#127; LM
2019-2020&amp;#127; 86519&amp;#127; LM
2019-2020 &amp;#127;86519&amp;#127; IB
;;;;

proc sort data=Have;
	by 'Academic Year'n StudentUID;
run;

data Want;
	set Have;
	by 'Academic Year'n StudentUID;
   	length Department1 $ 4.;
	retain Dpt;
		if findw(Department,'YBC')&amp;gt;0 then do;
			Dpt = 'YBC';
			if Department in ('YBC','YB','CT','CAR') then 
					Department1 = DPT;
			else 
				Department1 = Department;
		drop Dpt;
		end;
		if findw(Department,'CDCA')&amp;gt;0 then do;
			Dpt = 'CDCA';
			if Department in ('CDCA','NCT') then 
					Department1 = DPT;
			else 
				Department1 = Department;
		drop Dpt;
		end;
		if findw(Department,'MOA')&amp;gt;0 then do;
			Dpt = 'MOA';
			if Department in ('MOA','RH') then 
					Department1 = DPT;
			else 
				Department1 = Department;
		drop Dpt;
		end;
		if findw(Department,'MAA')&amp;gt;0 then do;
			Dpt = 'MAA';
			if Department in ('MAA','RH') then 
					Department1 = DPT;
			else 
				Department1 = Department;
		drop Dpt;
		end;
		if findw(Department,'IB')&amp;gt;0 then do;
			Dpt = 'IB';
			if Department in ('IB','LM') then 
					Department1 = DPT;
			else 
				Department1 = Department;
		drop Dpt;
		end;
run;

Want:
Academic Year	StudentUID	Department	Department1
2017-2018	83136	CAR	YBC
2017-2018	83136	CAR	YBC
2017-2018	83136	CT	YBC
2017-2018	83136	YB	YBC
2017-2018	83136	YB	YBC
2017-2018	83136	YBC	YBC
2017-2018	83136	CAR	YBC
2017-2018	88069	NCT	CDCA
2017-2018	88069	NCT	CDCA
2017-2018	88069	ES	ES
2017-2018	88069	CDCA	CDCA
2018-2019	83882	MOA	MOA
2018-2019	83882	MOA	MOA
2018-2019	83882	RH	MOA
2018-2019	83882	RH	MOA
2018-2019	83882	RH	MOA
2018-2019	83882	MOA	MOA
2018-2019	83882	MOA	MOA
2018-2019	83882	MOA	MOA
2018-2019	83882	ES	ES
2018-2019	83882	ES	ES
2019-2020	86518	RH	MAA
2019-2020	86518	RH	MAA
2019-2020	86518	MAA	MAA
2019-2020	86518	MAA	MAA
2019-2020	86518	MAA	MAA
2019-2020	86518	ES	ES
2019-2020	86518	ES	ES
2019-2020	86519	IB	IB
2019-2020	86519	IB	IB
2019-2020	86519	IB	IB
2019-2020	86519	LM	IB
2019-2020	86519	LM	IB
2019-2020	86519	IB	IB
&lt;/PRE&gt;</description>
      <pubDate>Sun, 26 Jul 2020 01:56:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correct-Entries/m-p/672338#M202046</guid>
      <dc:creator>twildone</dc:creator>
      <dc:date>2020-07-26T01:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: Correct Entries</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correct-Entries/m-p/672362#M202056</link>
      <description>&lt;P&gt;It looks like you are just doing a straight recode of department for certain values.&amp;nbsp; If so then this simple code should work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   set have;
   length department1 $4;

   select (department);
      when ('YBC','YB','CT','CAR') department1 = 'YBC';
      when ('CDCA','NCT') department1 = 'CDCA';
      when ('MAA','RH') department1 = 'MAA';
      when ('IB','LM') department1 = 'IB';
      otherwise department1 = department;
   end;

run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jul 2020 01:19:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correct-Entries/m-p/672362#M202056</guid>
      <dc:creator>qatman28</dc:creator>
      <dc:date>2020-07-26T01:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: Correct Entries</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correct-Entries/m-p/672364#M202057</link>
      <description>&lt;P&gt;Is this just about re-coding? If so then a format could be quite useful.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
  value $dpt
    'YBC','YB','CT','CAR' = 'YBC'
    'CDCA','NCT'          = 'CDCA'
    'MAA','RH'            = 'MAA'
    'IB','LM'             = 'IB'
  ;
run;

data want;
  set have;
  Department1=put(Department, $dpt.);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 26 Jul 2020 02:43:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correct-Entries/m-p/672364#M202057</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-07-26T02:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: Correct Entries</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correct-Entries/m-p/672371#M202062</link>
      <description>&lt;P&gt;You only one drop statement anywhere in the data step.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jul 2020 05:30:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correct-Entries/m-p/672371#M202062</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-07-26T05:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: Correct Entries</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correct-Entries/m-p/672400#M202082</link>
      <description>&lt;P&gt;Hi...This is not straight forward of just re-coding. Some courses recieve credit toward other programs. For example, the course with a Department of RH receives credit toward MAA, MOA as well as RH programs. So as to know which program that the student is receiving credit for the course, I need to first find out which program that the student is enrolled in for that academic year which I am attempting to do with the statement with the findw. Then I know which department codes need to recoded.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jul 2020 15:45:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correct-Entries/m-p/672400#M202082</guid>
      <dc:creator>twildone</dc:creator>
      <dc:date>2020-07-26T15:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: Correct Entries</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correct-Entries/m-p/672401#M202083</link>
      <description>The posted code produces a variable "department1" per your wanted output. If you have a separate question then please ask, otherwise it appears that the code from Patrick or myself works.</description>
      <pubDate>Sun, 26 Jul 2020 16:00:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correct-Entries/m-p/672401#M202083</guid>
      <dc:creator>qatman28</dc:creator>
      <dc:date>2020-07-26T16:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: Correct Entries</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correct-Entries/m-p/672403#M202085</link>
      <description>The posted Department1 for StudentUID=86518 is MAA. When I ran your code, I am getting both MAA and MOA for this same StudentUID.</description>
      <pubDate>Sun, 26 Jul 2020 16:35:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correct-Entries/m-p/672403#M202085</guid>
      <dc:creator>twildone</dc:creator>
      <dc:date>2020-07-26T16:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: Correct Entries</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correct-Entries/m-p/672408#M202090</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4061"&gt;@twildone&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;The posted Department1 for StudentUID=86518 is MAA. When I ran your code, I am getting both MAA and MOA for this same StudentUID.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What is the meaning of the new variable?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your words make it sound like you want the student's department to drive the remapping.&amp;nbsp; But your input does not have a student level department variable.&amp;nbsp; The existing data just have the one department variable the observation level.&amp;nbsp; Most of your students have more than one department listed.&amp;nbsp; How do you want to pick the department for the remapping?&lt;/P&gt;
&lt;PRE&gt;      Student   Academic
Obs     UID       Year      dept1   dept2   dept3   dept4   dept5   dept6   dept7   dept8   dept9   dept10

 1     83136    2017-2018    CAR     CAR     CT     YB       YB      YBC     CAR
 2     83882    2018-2019    MOA     MOA     RH     RH       RH      MOA     MOA     MOA     ES       ES
 3     86518    2019-2020    RH      RH      MAA    MAA      MAA     ES      ES
 4     86519    2019-2020    IB      IB      IB     LM       LM      IB
 5     88069    2017-2018    NCT     NCT     ES     CDCA
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jul 2020 18:45:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correct-Entries/m-p/672408#M202090</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-07-26T18:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: Correct Entries</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correct-Entries/m-p/672409#M202091</link>
      <description>&lt;P&gt;Your posted data step is going to create problems.&amp;nbsp; Does your real data have these problems?&lt;/P&gt;
&lt;PRE&gt;1206  data posted;
1207      length 'AcademicYear'n $ 9 StudentUID 8 Department $ 4;
1208      format 'AcademicYear'n $char9. StudentUID best12. Department $char4.;
1209      informat 'AcademicYear'n $char9. StudentUID best12. Department $char4.;
1210      infile datalines4 dlm='7f'x missover dsd;
1211      input 'AcademicYear'n : $char9. StudentUID : best32. Department : $char4.;
1212  datalines4;

NOTE: Invalid data for StudentUID in line 1234 11-19.
RULE:       ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+

1234CHAR    2019-2020. 86518 RH
    ZONE    33332333372333332542222222222222222222222222222222222222222222222222222222222222
    NUMR    2019D2020F0865180280000000000000000000000000000000000000000000000000000000000000
'AcademicYear'n=2019-2020 StudentUID=. Department=  _ERROR_=1 _N_=22
NOTE: Invalid data for StudentUID in line 1237 11-20.

1237CHAR    2019-2020. 86518 MAA
    ZONE    33332333372333332444222222222222222222222222222222222222222222222222222222222222
    NUMR    2019D2020F0865180D11000000000000000000000000000000000000000000000000000000000000
'AcademicYear'n=2019-2020 StudentUID=. Department=  _ERROR_=1 _N_=25
NOTE: The data set WORK.POSTED has 34 observations and 3 variables.
&lt;/PRE&gt;
&lt;P&gt;Plus you will create 19 observations where DEPARTMENT starts with a space because you are using $CHAR informat instead of just reading the string normally.&lt;/P&gt;
&lt;P&gt;Try using a more normal data step since non of your variables require any special informats or formats and you don't have any missing values to worry about.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
    length AcademicYear $ 9 StudentUID 8 Department $ 4;
    input AcademicYear StudentUID Department;
datalines4;
2017-2018  83136  CAR
2017-2018  83136  CAR
2017-2018  83136  CT
2017-2018  83136  YB
2017-2018  83136  YB
2017-2018  83136  YBC
2017-2018  83136  CAR
2017-2018  88069  NCT
2017-2018  88069  NCT
2017-2018  88069  ES
2017-2018  88069  CDCA
2018-2019  83882  MOA
2018-2019  83882  MOA
2018-2019  83882  RH
2018-2019  83882  RH
2018-2019  83882  RH
2018-2019  83882  MOA
2018-2019  83882  MOA
2018-2019  83882  MOA
2018-2019  83882  ES
2018-2019  83882  ES
2019-2020  86518 RH
2019-2020  86518  RH
2019-2020  86518  MAA
2019-2020  86518 MAA
2019-2020  86518  MAA
2019-2020  86518  ES
2019-2020  86518  ES
2019-2020  86519  IB
2019-2020  86519  IB
2019-2020  86519  IB
2019-2020  86519  LM
2019-2020  86519  LM
2019-2020  86519  IB
;;;;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jul 2020 18:59:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correct-Entries/m-p/672409#M202091</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-07-26T18:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: Correct Entries</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correct-Entries/m-p/672411#M202092</link>
      <description>&lt;P&gt;Hi Tom....thanks for your suggestion. I made the changes and have been working on this by trying different things. The code below seems to be getting closer to what I need. I used the max_Dpt approach so I can test to make sure only the student records that need to be changed are changed. By changing the YBC to YB, for example, for StudentUID 83136, then none of the Department codes should change and that is what is happening. The issue that I am still having problems with is&amp;nbsp;dealing with&amp;nbsp;courses that receive credit in more than one program (ie. RH can receive credit in MOA, MAA as well as RH). I&amp;nbsp;thought by using the &amp;nbsp;"by AcademicYear StudentUID" statement that it would take care of that problem as each student would be evaluated separately.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have;
    length AcademicYear $ 9 StudentUID 8 Department $ 5;
    input AcademicYear StudentUID Department;
datalines4;
2017-2018  83136  CAR
2017-2018  83136  CAR
2017-2018  83136  CT
2017-2018  83136  YB
2017-2018  83136  YB
2017-2018  83136  YBC
2017-2018  83136  CAR
2017-2018  88069  NCT
2017-2018  88069  NCT
2017-2018  88069  ES
2017-2018  88069  CDCA
2018-2019  83882  MOA
2018-2019  83882  MOA
2018-2019  83882  RH
2018-2019  83882  RH
2018-2019  83882  RH
2018-2019  83882  MOA
2018-2019  83882  MOA
2018-2019  83882  MOA
2018-2019  83882  ES
2018-2019  83882  ES
2019-2020  86518 RH
2019-2020  86518  RH
2019-2020  86518  MAA
2019-2020  86518 MAA
2019-2020  86518  MAA
2019-2020  86518  ES
2019-2020  86518  ES
2019-2020  86519  IB
2019-2020  86519  IB
2019-2020  86519  IB
2019-2020  86519  LM
2019-2020  86519  LM
2019-2020  86519  IB
;;;;

proc sort data=Have;
	by AcademicYear StudentUID;
run;

data Have;
	set Have;
		if Department in ('YBC','CDCA','MOA','MAA','IB') then 
			Dpt = 1;
run;

data Have(drop=Dpt);  
   max_Dpt=.;
   do until (last.StudentUID);
      set Have;
      by AcademicYear StudentUID;
      if Dpt gt max_Dpt then max_Dpt=Dpt;
   end;
   do until (last.StudentUID);
      set Have;
      by AcademicYear StudentUID;
      output;
   end;
   rename max_Dpt=Dpt1;
run;

data Want(drop=Dpt1);
	set Have;
	by AcademicYear StudentUID;
   	length Department1 $ 5.;
			if Dpt1=1 and Department in ('YBC','YB','CT','CAR') then 
					Department1 = 'YBC';
			else 
			if Dpt1=1 and Department in ('CDCA','NCT') then 
					Department1 = 'CDCA';
			else 
			if Dpt1=1 and Department in ('MOA','RH') then 
					Department1 = 'MOA';
			else 
			if Dpt1=1 and Department in ('MAA','RH') then 
					Department1 = 'MAA';
			else 
			if Dpt1=1 and Department in ('IB','LM') then 
					Department1 = 'IB';
			else 
				Department1 = Department;
run;
&lt;/PRE&gt;</description>
      <pubDate>Sun, 26 Jul 2020 19:55:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correct-Entries/m-p/672411#M202092</guid>
      <dc:creator>twildone</dc:creator>
      <dc:date>2020-07-26T19:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: Correct Entries</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correct-Entries/m-p/672415#M202094</link>
      <description>&lt;P&gt;Hi Tom.....I think I might have got this to work. Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data Have;
	set Have;
		if Department in ('YBC') then
			Dpt = 1;
		if Department in ('CDCA') then
			Dpt = 2;
		if Department in ('MOA') then
			Dpt = 3;
		if Department in ('MAA') then
			Dpt = 4;
		if Department in ('IB') then
			Dpt = 5;
run;

data Have(drop=Dpt);  
   max_Dpt=.;
   do until (last.StudentUID);
      set Have;
      by AcademicYear StudentUID;
      if Dpt gt max_Dpt then max_Dpt=Dpt;
   end;
   do until (last.StudentUID);
      set Have;
      by AcademicYear StudentUID;
      output;
   end;
   rename max_Dpt=Dpt1;
run; 

data Want(drop=Dpt1);
	set Have;
	by AcademicYear StudentUID;
   	length Department1 $ 5.;
			if Dpt1=1 and Department in ('YBC','YB','CT','CAR') then 
					Department1 = 'YBC';
			else 
			if Dpt1=2 and Department in ('CDCA','NCT') then 
					Department1 = 'CDCA';
			else 
			if Dpt1=3 and Department in ('MOA','RH') then 
					Department1 = 'MOA';
			else 
			if Dpt1=4 and Department in ('MAA','RH') then 
					Department1 = 'MAA';
			else 
			if Dpt1=5 and Department in ('IB','LM') then 
					Department1 = 'IB';
			else 
				Department1 = Department;
run;&lt;/PRE&gt;</description>
      <pubDate>Sun, 26 Jul 2020 20:42:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correct-Entries/m-p/672415#M202094</guid>
      <dc:creator>twildone</dc:creator>
      <dc:date>2020-07-26T20:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: Correct Entries</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correct-Entries/m-p/672421#M202097</link>
      <description>&lt;P&gt;1. The weird formatting of your code is because you use tabs.&lt;/P&gt;
&lt;P&gt;I am a firm proponent of using spaces, so that formatting is not broken when code is moved.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. The line&lt;/P&gt;
&lt;PRE&gt;	by AcademicYear StudentUID;
&lt;/PRE&gt;
&lt;P&gt;in your last step serves no purpose and slows down the process.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Can't this be done in one data step?&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jul 2020 23:11:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correct-Entries/m-p/672421#M202097</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-07-26T23:11:08Z</dc:date>
    </item>
  </channel>
</rss>

