<?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: Proc transpose with multiple variables in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-with-multiple-variables/m-p/479611#M71485</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/221614"&gt;@rhilty&lt;/a&gt;&amp;nbsp; Try&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile cards truncover;
input PublicId $	ExperienceType  &amp;amp; $50.	JobTitle  &amp;amp; $50.	StartDate &amp;amp; $50.	EndDate &amp;amp; $50.;
cards;
A2	Administrative Support Staff		Adminstrator/Teacher	2001-07-09 00:00:00.000		2013-09-02 00:00:00.000
A2	Education Coordinator/Ed Lead		Administrator	2013-09-09 00:00:00.000		2017-05-31 00:00:00.000
A2	Early Learning Teacher		State Pre-Kindergarten Teacher	2017-08-06 00:00:00.000	 .
A3	Elementary Teacher		State Pre-K Teacher		2015-08-24 00:00:00.000	  .
A3	Early Learning Teacher		PreK Lead Teacher/ Jr. K	2011-05-23 00:00:00.000		2015-08-21 00:00:00.000
A3	Early Learning Teacher		PreK Lead Teacher	1999-09-06 00:00:00.000		2008-02-09 00:00:00.000
A3	Early Learning Teacher		PreK Lead Teacher	2008-08-04 00:00:00.000		2011-02-11 00:00:00.000
;
run;
proc transpose data=have out=_w(keep=PublicId ExperienceType _name_ col1);
by _all_ notsorted;
var ExperienceType	JobTitle	StartDate	EndDate;
run;
data __w;
set _w;
by 	PublicId  ExperienceType notsorted;
if first.publicid then grp=0;
if _name_='ExperienceType' then grp+1;
keep  publicid _name_ grp col1 ;
run;

proc transpose data=__w  out=want(drop=_name_) ;
by PublicId   notsorted;
var   col1 ;
id _name_ grp;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 19 Jul 2018 17:55:29 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2018-07-19T17:55:29Z</dc:date>
    <item>
      <title>Proc transpose with multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-with-multiple-variables/m-p/478875#M71419</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm wondering if anyone knows a way to transpose multiple variables while pairing them based on the original dataset. I have a file organized by ID number with information about coursework and the institutional affiliation of each course.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So my data look like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;PublicId&lt;/TD&gt;&lt;TD&gt;FirstName&lt;/TD&gt;&lt;TD&gt;LastName&lt;/TD&gt;&lt;TD&gt;Institution&lt;/TD&gt;&lt;TD&gt;CourseTitle&lt;/TD&gt;&lt;TD&gt;Credit&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A2&lt;/TD&gt;&lt;TD&gt;FN&lt;/TD&gt;&lt;TD&gt;LN&lt;/TD&gt;&lt;TD&gt;UMN&lt;/TD&gt;&lt;TD&gt;Parent and Child Relations&lt;/TD&gt;&lt;TD&gt;3.00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A2&lt;/TD&gt;&lt;TD&gt;FN&lt;/TD&gt;&lt;TD&gt;LN&lt;/TD&gt;&lt;TD&gt;UMN&lt;/TD&gt;&lt;TD&gt;Orientation to Human Services&lt;/TD&gt;&lt;TD&gt;3.00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A2&lt;/TD&gt;&lt;TD&gt;FN&lt;/TD&gt;&lt;TD&gt;LN&lt;/TD&gt;&lt;TD&gt;Tufts&lt;/TD&gt;&lt;TD&gt;Child Growth And Development&lt;/TD&gt;&lt;TD&gt;3.00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A2&lt;/TD&gt;&lt;TD&gt;FN&lt;/TD&gt;&lt;TD&gt;LN&lt;/TD&gt;&lt;TD&gt;Tufts&lt;/TD&gt;&lt;TD&gt;Curric for Early Childhood&lt;/TD&gt;&lt;TD&gt;3.00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A2&lt;/TD&gt;&lt;TD&gt;FN&lt;/TD&gt;&lt;TD&gt;LN&lt;/TD&gt;&lt;TD&gt;Macalester&lt;/TD&gt;&lt;TD&gt;Fund Of Writing&lt;/TD&gt;&lt;TD&gt;3.00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A2&lt;/TD&gt;&lt;TD&gt;FN&lt;/TD&gt;&lt;TD&gt;LN&lt;/TD&gt;&lt;TD&gt;Macalester&lt;/TD&gt;&lt;TD&gt;General Psych&lt;/TD&gt;&lt;TD&gt;3.00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A2&lt;/TD&gt;&lt;TD&gt;FN&lt;/TD&gt;&lt;TD&gt;LN&lt;/TD&gt;&lt;TD&gt;Macalester&lt;/TD&gt;&lt;TD&gt;Field Exp Seminar 1&lt;/TD&gt;&lt;TD&gt;3.00&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;And I'd like it to look like this:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;PublicId&lt;/TD&gt;&lt;TD&gt;Course1&lt;/TD&gt;&lt;TD&gt;Institution1&lt;/TD&gt;&lt;TD&gt;Course2&lt;/TD&gt;&lt;TD&gt;Institution2&lt;/TD&gt;&lt;TD&gt;Course3&lt;/TD&gt;&lt;TD&gt;Institution3&lt;/TD&gt;&lt;TD&gt;Course4&lt;/TD&gt;&lt;TD&gt;Institution4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A2&lt;/TD&gt;&lt;TD&gt;Parent and Child Relations&lt;/TD&gt;&lt;TD&gt;UMN&lt;/TD&gt;&lt;TD&gt;Orientation to Human Services&lt;/TD&gt;&lt;TD&gt;Child Growth And Development&lt;/TD&gt;&lt;TD&gt;Tufts&lt;/TD&gt;&lt;TD&gt;Curric for Early Childhood&lt;/TD&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;Tufts&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I created a count variable to reshape the data using proc transpose, but I can't seem to get my desired output. I can only get one variable to transpose at a time. Here is what I have so far. Any help would be much appreciated!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.WFR_Coursework;&lt;BR /&gt;set access.WFR_Coursework;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;* creating a variable for the number of courses each teacher has */

data WFR_Coursework1;
	set WFR_Coursework;
	count + 1;
	by PublicId;
	if first.PublicId then count =1;
run;

/* check the new variable */

proc freq data = WFR_Coursework1;
	table count/list missing;
run;

proc print data = WFR_Coursework1 (obs = 5);
run;

/* now reshape according to the count while copying the other variables into the new dataset */

proc transpose data = WFR_Coursework1
	out = WFR_CourseworkMiddle
	prefix = Course
	name = CourseTitle;
var CourseTitle;
by PublicId;

run; 

proc transpose data = WFR_CourseworkMiddle
	out = WFR_CourseworkNEW
	delim=_;
	id Institution _name_ ;
	var Course1-Course57;
	by PublicID;

run;

proc print data = WFR_CourseworkNEW (obs = 5);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jul 2018 00:58:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-with-multiple-variables/m-p/478875#M71419</guid>
      <dc:creator>rhilty</dc:creator>
      <dc:date>2018-07-18T00:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: Proc transpose with multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-with-multiple-variables/m-p/478898#M71421</link>
      <description>&lt;P&gt;are you sure your sample output for your input sample is correct?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;some institutions have course values and vice versa??????????&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jul 2018 03:56:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-with-multiple-variables/m-p/478898#M71421</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-07-18T03:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: Proc transpose with multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-with-multiple-variables/m-p/478899#M71422</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/221614"&gt;@rhilty&lt;/a&gt;&amp;nbsp;see if this helps?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
input (PublicId	FirstName	LastName	Institution) ($)	CourseTitle &amp;amp; $75.	Credit ;
cards;
A2	FN	LN	UMN	Parent and Child Relations	    3.00
A2	FN	LN	UMN	Orientation to Human Services	  3.00
A2	FN	LN	Tufts	Child Growth And Development	 3.00
A2	FN	LN	Tufts	Curric for Early Childhood	   3.00
A2	FN	LN	Macalester	Fund Of Writing	  3.00
A2	FN	LN	Macalester	General Psych	  3.00
A2	FN	LN	Macalester	Field Exp Seminar 1	 3.00
;

proc transpose data=have out=_w;
by PublicId Institution CourseTitle notsorted;
var Institution CourseTitle;
run;

data __w;
set _w;
by 	PublicId  CourseTitle notsorted;
if first.publicid then grp=0;
if first.CourseTitle then grp+1;
keep  publicid _name_ grp col1;
run;

proc transpose data=__w  out=want(drop=_name_) ;
by PublicId   notsorted;
var   col1 ;
id _name_ grp;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Jul 2018 04:02:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-with-multiple-variables/m-p/478899#M71422</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-07-18T04:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: Proc transpose with multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-with-multiple-variables/m-p/479351#M71451</link>
      <description>&lt;P&gt;This is exactly what I needed! THANK YOU!&amp;nbsp;&lt;img id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://communities.sas.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 02:23:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-with-multiple-variables/m-p/479351#M71451</guid>
      <dc:creator>rhilty</dc:creator>
      <dc:date>2018-07-19T02:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: Proc transpose with multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-with-multiple-variables/m-p/479366#M71452</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/221614"&gt;@rhilty&lt;/a&gt;&amp;nbsp;Thank you for the feedback. May i request you to please mark the solution as accepted and close the thread?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 03:37:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-with-multiple-variables/m-p/479366#M71452</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-07-19T03:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: Proc transpose with multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-with-multiple-variables/m-p/479465#M71459</link>
      <description>&lt;P&gt;Quick follow-up &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;... I tried running this code on a similar dataset where, instead of looking at college courses by teacher (PublicId), we're looking at different jobs over time, all of which are stored on separate rows. This dataset has more variables than the last one, and some of the values are duplicated. For example, one teacher might have had the ExperienceType "Administrative Support Staff" under multiple entries. However, their JobTitle, StartDate, and EndDate all vary.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the piece of the code that is returning the error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data = WFR_Employment1
	out = WFR_EmploymentMiddle;
var ExperienceType JobTitle StartDate EndDate;
by PublicId ExperienceType JobTitle StartDate EndDate notsorted;
run; 

data WFR_EmploymentMiddle;
set WFR_EmploymentMiddle;
by PublicId ExperienceType notsorted;
if first.PublicId then grp=0;
if first.ExperienceType then grp+1;
keep PublicId _name_ grp col1;
run;

proc transpose data = WFR_EmploymentMiddle
	out = WFR_EmploymentNEW (drop=_name_);
	by PublicId notsorted;
	var col1;
	id _name_ grp;

run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And here is part of the error (it's repeated for many of the IDs in the dataset):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;71   proc transpose data = WFR_EmploymentMiddle
72       out = WFR_EmploymentNEW (drop=_name_);
73       by PublicId notsorted;
74       var col1;
75       id _name_ grp;
76
77   run;

ERROR: The ID value "ExperienceType2" occurs twice in the same BY group.
ERROR: The ID value "JobTitle2" occurs twice in the same BY group.
ERROR: The ID value "StartDate2" occurs twice in the same BY group.
ERROR: The ID value "EndDate2" occurs twice in the same BY group.
ERROR: The ID value "ExperienceType2" occurs twice in the same BY group.
ERROR: The ID value "JobTitle2" occurs twice in the same BY group.
ERROR: The ID value "StartDate2" occurs twice in the same BY group.
ERROR: The ID value "EndDate2" occurs twice in the same BY group.
NOTE: The above message was for the following BY group:
      PublicId=A07608&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could it be an issue that certain values are duplicated, or is the issue the number of variables I'm trying to pair? Thank you again for your help figuring this out! I'm not even sure what to Google on this one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rowan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 11:53:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-with-multiple-variables/m-p/479465#M71459</guid>
      <dc:creator>rhilty</dc:creator>
      <dc:date>2018-07-19T11:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: Proc transpose with multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-with-multiple-variables/m-p/479508#M71461</link>
      <description>&lt;P&gt;Good morning&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/221614"&gt;@rhilty&lt;/a&gt;&amp;nbsp; It's difficult to tell without knowing the data as I can only guess there might be huge variances between the two samples. You came into the forum with an interesting and tricky not so conventional transpose and it that took me a good 12-15 mins to think through the grouping variables in the first place before my fingers started typing the syntax. A really good one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For your additional requirement, your best is to provide a clear and &lt;EM&gt;&lt;STRONG&gt;representative&lt;/STRONG&gt;&lt;/EM&gt; sample of your real with an expected output for that input sample. This helps for anybody to comfortably comprehend and respond with a one stop shop solution&amp;nbsp; that you could copy paste to a production environment. My 2 cents!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 14:13:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-with-multiple-variables/m-p/479508#M71461</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-07-19T14:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: Proc transpose with multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-with-multiple-variables/m-p/479550#M71467</link>
      <description>&lt;P&gt;Thanks for the feedback &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;! I'm new to the forum (and to SAS) so it's helpful to hear what's most useful for figuring out solutions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are a few rows of the data. I changed the ID numbers for data security reasons but can tell you that PublicId A3 yielded the error I included above (although this was just one of many IDs that came up with the same set of errors).&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PublicId	ExperienceType	JobTitle	StartDate	EndDate
A2	Administrative Support Staff	Adminstrator/Teacher	2001-07-09 00:00:00.000	2013-09-02 00:00:00.000
A2	Education Coordinator/Educational Lead	Administrator	2013-09-09 00:00:00.000	2017-05-31 00:00:00.000
A2	Early Learning Teacher	State Pre-Kindergarten Teacher	2017-08-06 00:00:00.000	
A3	Elementary Teacher	State Pre-K Teacher	2015-08-24 00:00:00.000	
A3	Early Learning Teacher	PreK Lead Teacher/ Jr. Kindergarten	2011-05-23 00:00:00.000	2015-08-21 00:00:00.000
A3	Early Learning Teacher	PreK Lead Teacher	1999-09-06 00:00:00.000	2008-02-09 00:00:00.000
A3	Early Learning Teacher	PreK Lead Teacher	2008-08-04 00:00:00.000	2011-02-11 00:00:00.000
A4	Early Learning Teacher Assistant	TEACHER ASSISTANT	1981-09-07 00:00:00.000	
A5	Early Learning Teacher	Lead Teacher State Funded PreK	2010-09-07 00:00:00.000	
A5	Early Learning Teacher	Teacher	2015-08-17 00:00:00.000	
A5	Early Learning Teacher	Teacher	1984-09-17 00:00:00.000	1985-09-17 00:00:00.000
A5	Early Learning Teacher	Teacher	1985-09-17 00:00:00.000	2015-08-17 00:00:00.000&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 15:53:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-with-multiple-variables/m-p/479550#M71467</guid>
      <dc:creator>rhilty</dc:creator>
      <dc:date>2018-07-19T15:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: Proc transpose with multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-with-multiple-variables/m-p/479579#M71473</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/221614"&gt;@rhilty&lt;/a&gt;&amp;nbsp;that data makes my eyes hurt. Can you attach and excel sheet and also with an output sample plz&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 17:02:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-with-multiple-variables/m-p/479579#M71473</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-07-19T17:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: Proc transpose with multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-with-multiple-variables/m-p/479581#M71474</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;here you go!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 17:09:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-with-multiple-variables/m-p/479581#M71474</guid>
      <dc:creator>rhilty</dc:creator>
      <dc:date>2018-07-19T17:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: Proc transpose with multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-with-multiple-variables/m-p/479611#M71485</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/221614"&gt;@rhilty&lt;/a&gt;&amp;nbsp; Try&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile cards truncover;
input PublicId $	ExperienceType  &amp;amp; $50.	JobTitle  &amp;amp; $50.	StartDate &amp;amp; $50.	EndDate &amp;amp; $50.;
cards;
A2	Administrative Support Staff		Adminstrator/Teacher	2001-07-09 00:00:00.000		2013-09-02 00:00:00.000
A2	Education Coordinator/Ed Lead		Administrator	2013-09-09 00:00:00.000		2017-05-31 00:00:00.000
A2	Early Learning Teacher		State Pre-Kindergarten Teacher	2017-08-06 00:00:00.000	 .
A3	Elementary Teacher		State Pre-K Teacher		2015-08-24 00:00:00.000	  .
A3	Early Learning Teacher		PreK Lead Teacher/ Jr. K	2011-05-23 00:00:00.000		2015-08-21 00:00:00.000
A3	Early Learning Teacher		PreK Lead Teacher	1999-09-06 00:00:00.000		2008-02-09 00:00:00.000
A3	Early Learning Teacher		PreK Lead Teacher	2008-08-04 00:00:00.000		2011-02-11 00:00:00.000
;
run;
proc transpose data=have out=_w(keep=PublicId ExperienceType _name_ col1);
by _all_ notsorted;
var ExperienceType	JobTitle	StartDate	EndDate;
run;
data __w;
set _w;
by 	PublicId  ExperienceType notsorted;
if first.publicid then grp=0;
if _name_='ExperienceType' then grp+1;
keep  publicid _name_ grp col1 ;
run;

proc transpose data=__w  out=want(drop=_name_) ;
by PublicId   notsorted;
var   col1 ;
id _name_ grp;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Jul 2018 17:55:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-with-multiple-variables/m-p/479611#M71485</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-07-19T17:55:29Z</dc:date>
    </item>
  </channel>
</rss>

