<?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: Rearrange  Variables in the same Column in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898963#M355316</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you. I just have one issue. When I run the code in SAS Studio it runs fine. However, when I&amp;nbsp;&lt;/P&gt;
&lt;P&gt;run the code in SAS 9.4 I receive an error on this part of code:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;if (PUT(Chararacteristic,$subs.)='*') then sub_char = Chararacteristic;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;that the Error 48-59: The format subs was not found or could not be loaded. The format was created successfully&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in the previous step.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 17 Oct 2023 15:41:17 GMT</pubDate>
    <dc:creator>luvscandy27</dc:creator>
    <dc:date>2023-10-17T15:41:17Z</dc:date>
    <item>
      <title>Rearrange  Variables in the same Column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898909#M355296</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am in need of your assistance please. I have data like this:&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="348"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="214"&gt;Chararacteristic&lt;/TD&gt;
&lt;TD width="134"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;White only:&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Below poverty&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; At or above poverty&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Black or African American only:&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Below poverty&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; At or above poverty&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Hispanic or Latino:&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&amp;nbsp; Below poverty&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp; At or above poverty&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I am trying to get my data like below. Any suggestions would be greatly appreciated:&lt;/P&gt;
&lt;TABLE width="348"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="214"&gt;White only:&lt;/TD&gt;
&lt;TD width="134"&gt;Below Poverty&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;White only:&lt;/TD&gt;
&lt;TD&gt;At or above poverty&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Black or African American only:&lt;/TD&gt;
&lt;TD&gt;Below Poverty&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Black or African American only:&lt;/TD&gt;
&lt;TD&gt;At or above poverty&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Hispanic or Latino:&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;Below Poverty&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Hispanic or Latino:&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;At or above poverty&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Tue, 17 Oct 2023 12:28:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898909#M355296</guid>
      <dc:creator>luvscandy27</dc:creator>
      <dc:date>2023-10-17T12:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: Rearrange  Variables in the same Column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898916#M355299</link>
      <description>&lt;P&gt;One way to do so is creating two temporary variables and mapping values from the source variable there using RETAIN;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;eg;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile cards dlm=',' truncover;
length Chararacteristic $100;
input Chararacteristic;
cards; 
White only:,	 
Below poverty,	 
At or above poverty,	 
Black or African American only:,	 
    Below poverty,	 
    At or above poverty,	 
Hispanic or Latino:, 	 
   Below poverty,	 
  At or above poverty
;
proc print; run; 

data want;
	set have;
	length temp1 temp2 $100;
	retain temp1;
	if find(Chararacteristic, ':') gt 0 then temp1= Chararacteristic;
	else temp2=Chararacteristic;
	if temp2 ne '';
	drop Chararacteristic;
proc print;run; 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Oct 2023 13:15:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898916#M355299</guid>
      <dc:creator>A_Kh</dc:creator>
      <dc:date>2023-10-17T13:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: Rearrange  Variables in the same Column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898923#M355300</link>
      <description>&lt;P&gt;I'm sure the solution from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/321371"&gt;@A_Kh&lt;/a&gt;&amp;nbsp;works, but question for&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/255656"&gt;@luvscandy27&lt;/a&gt;: are you 100% sure that there will always be a colon at the end of the text that you want to stay in column 1 and never a colon in the text you want to move to column 2?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 14:04:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898923#M355300</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-10-17T14:04:33Z</dc:date>
    </item>
    <item>
      <title>Re: Rearrange  Variables in the same Column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898927#M355301</link>
      <description>&lt;P&gt;There will not always be a colon at the end. This is just a portion of the dataset. The dataset has several situations&amp;nbsp;&lt;/P&gt;
&lt;P&gt;like the one I posted. I was hoping if i got a solution, I would be able to modify the code and apply the code to similar situations&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in the dataset.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 14:03:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898927#M355301</guid>
      <dc:creator>luvscandy27</dc:creator>
      <dc:date>2023-10-17T14:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: Rearrange  Variables in the same Column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898928#M355302</link>
      <description>&lt;P&gt;Please explain the structure of the data to us, so we can help provide a solution.&amp;nbsp;What is the proper indication in the text that indicates text that is to stay in column 1, or that indicates text that should be moved to column 2? Please provide sample data that is more realistic to your actual problem.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 14:05:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898928#M355302</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-10-17T14:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: Rearrange  Variables in the same Column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898930#M355303</link>
      <description>&lt;P&gt;Below please see the a sample of the table:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Reeza_0-1697560229822.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/88915iDAEA4F276FE617D0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Reeza_0-1697560229822.png" alt="Reeza_0-1697560229822.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Source in PDF:&amp;nbsp;&lt;A href="https://www.cdc.gov/nchs/data/hus/2020-2021/VaxCh.pdf" target="_blank"&gt;https://www.cdc.gov/nchs/data/hus/2020-2021/VaxCh.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Source in Excel:&amp;nbsp;&lt;A href="https://ftp.cdc.gov/pub/Health_Statistics/NCHS/Publications/Health_US/hus20-21tables/VaxCh.xlsx" target="_blank"&gt;https://ftp.cdc.gov/pub/Health_Statistics/NCHS/Publications/Health_US/hus20-21tables/VaxCh.xlsx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;There is not an identification variable which complicates thing even more.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 16:30:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898930#M355303</guid>
      <dc:creator>luvscandy27</dc:creator>
      <dc:date>2023-10-17T16:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: Rearrange  Variables in the same Column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898931#M355304</link>
      <description>&lt;P&gt;The complete table is segmented by types of vaccinations:&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;Combined 7-vaccine series&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;DT\PD\TDTap (4 doses or more)&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;Hepatitis A (2 doses or more)&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;Hepatitis B (3 doses or more)&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;Hib (full series)&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;Measles, mumps, rubella (1 dose or more)&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;PCV (4 doses or more)&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;Polio (3 doses or more)&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;Rotavirus vaccine&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;Varicella (1 dose or more)&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 14:17:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898931#M355304</guid>
      <dc:creator>luvscandy27</dc:creator>
      <dc:date>2023-10-17T14:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: Rearrange  Variables in the same Column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898934#M355306</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Perhaps you can come up with some rules, in words, that identify what text remains in column 1 and what text should move to column 2 (and is there a column 3 here?)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Also, I think we would need to see how this full table gets re-arranged, including the birth year columns.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The more you can tell us about what you want, the better chances we will have to create such code.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 14:18:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898934#M355306</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-10-17T14:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: Rearrange  Variables in the same Column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898935#M355307</link>
      <description>&lt;P&gt;That looks like a report.&amp;nbsp; Do you have it as a text file you are reading in?&lt;/P&gt;
&lt;P&gt;Do you really have it as a SAS dataset?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or do you have some other dataset that you used to produce that report?&amp;nbsp; If so what does that dataset look like.&amp;nbsp; What code did you use to produce that report?&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 14:19:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898935#M355307</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-10-17T14:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: Rearrange  Variables in the same Column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898936#M355308</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/255656"&gt;@luvscandy27&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;The complete table is segmented by types of vaccinations:&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;Combined 7-vaccine series&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;DT\PD\TDTap (4 doses or more)&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;Hepatitis A (2 doses or more)&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;Hepatitis B (3 doses or more)&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;Hib (full series)&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;Measles, mumps, rubella (1 dose or more)&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;PCV (4 doses or more)&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;Polio (3 doses or more)&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;Rotavirus vaccine&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;Varicella (1 dose or more)&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I don't see how this relates to the problem you asked about. Please explain this in more detail.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 14:19:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898936#M355308</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-10-17T14:19:41Z</dc:date>
    </item>
    <item>
      <title>Re: Rearrange  Variables in the same Column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898945#M355309</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/255656"&gt;@luvscandy27&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Stealing the part of the sample code from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/321371"&gt;@A_Kh&lt;/a&gt;, here is one way how you can get what you looking for&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Create sample data */
data have;
infile cards dlm=',' truncover;
length Chararacteristic $100;
input Chararacteristic;
cards; 
White only:,	 
Below poverty,	 
At or above poverty,	 
Black or African American only:,	 
    Below poverty,	 
    At or above poverty,	 
Hispanic or Latino:, 	 
   Below poverty,	 
  At or above poverty
;
run;

/* Create a Format that covers all sub-categories of interest regardless of their main characteristics */
proc formats lib=work;
	value $subs
	'Below poverty' = '*' 
	'At or above poverty' = '*'
	;
run;

data want (DROP=Chararacteristic);
	length main_char $40 sub_char $20;
	retain main_char;
	set have;
	if (PUT(Chararacteristic,$subs.)='*') then sub_char = Chararacteristic;
	else main_char = Chararacteristic;
	if sub_char ne ''; /* Remove header row (Main_char only) */
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 14:45:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898945#M355309</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2023-10-17T14:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: Rearrange  Variables in the same Column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898963#M355316</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you. I just have one issue. When I run the code in SAS Studio it runs fine. However, when I&amp;nbsp;&lt;/P&gt;
&lt;P&gt;run the code in SAS 9.4 I receive an error on this part of code:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;if (PUT(Chararacteristic,$subs.)='*') then sub_char = Chararacteristic;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;that the Error 48-59: The format subs was not found or could not be loaded. The format was created successfully&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in the previous step.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 15:41:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898963#M355316</guid>
      <dc:creator>luvscandy27</dc:creator>
      <dc:date>2023-10-17T15:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: Rearrange  Variables in the same Column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898964#M355317</link>
      <description>Check the fmtsearch option in your SAS 9.4 Display Manager.&lt;BR /&gt;Proc options option=fmtsearch; run;&lt;BR /&gt;if WORK is not part of it, then add WORK library to the option settings</description>
      <pubDate>Tue, 17 Oct 2023 15:47:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898964#M355317</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2023-10-17T15:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: Rearrange  Variables in the same Column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898969#M355321</link>
      <description>&lt;P&gt;My results were FMTSEARCH=(WORK LIBRARY)&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 16:13:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898969#M355321</guid>
      <dc:creator>luvscandy27</dc:creator>
      <dc:date>2023-10-17T16:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: Rearrange  Variables in the same Column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898970#M355322</link>
      <description>&lt;P&gt;Ugly...but I have done this lol.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Save it as a CSV file.&lt;/P&gt;
&lt;P&gt;Read the file in using a data step:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Use FIRSTOBS to control the first row of data read in.&lt;/LI&gt;
&lt;LI&gt;Make sure to play around with the informats to ensure you are reading in the first variable with all the spaces correctly counted.&lt;/LI&gt;
&lt;LI&gt;Create a variable that counts the number of spaces in front of the text&lt;/LI&gt;
&lt;LI&gt;Use that to create a level variable. That will tell you how many new variables you need to create as header variables. Looking closely at your data you have subtotals and totals all broken down so you need to account for that as well.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Once you have the levels sorted out, you can use RETAIN to keep the variable header counts in the right locations&lt;/LI&gt;
&lt;LI&gt;Add another column to indicate if a row is an aggregation/subtotal row&amp;nbsp; as well.&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Census bureaus have a format for these type of files that are shared via CSV and this is roughly how they do it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or...manually clean up the file, since it's likely a one time read &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 16:18:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898970#M355322</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-10-17T16:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: Rearrange  Variables in the same Column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898971#M355323</link>
      <description>FYI - your name is in screenshot - may want to remove in future.</description>
      <pubDate>Tue, 17 Oct 2023 16:21:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898971#M355323</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-10-17T16:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: Rearrange  Variables in the same Column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898972#M355324</link>
      <description>&lt;P&gt;Thank you. Do you know of anyway I can remove?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 16:25:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898972#M355324</guid>
      <dc:creator>luvscandy27</dc:creator>
      <dc:date>2023-10-17T16:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Rearrange  Variables in the same Column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898974#M355325</link>
      <description>&lt;P&gt;I removed it for you - just take slightly different screenshots in the future. Honestly, for this, I would just clean up the file manually and the excel is messy so you'd probably need to reference the PDF which is formatted correctly anyways &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS. please double check I have the links correctly and the right file attached. If not, you can click the side of the post and edit it as needed.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 16:38:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898974#M355325</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-10-17T16:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: Rearrange  Variables in the same Column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898988#M355332</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/255656"&gt;@luvscandy27&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hmm!, In this case I would double check the formats catalog in the WORK library, to ensure the $subs. format is created correctly.&amp;nbsp;&lt;BR /&gt;You might as well test it on a different data set.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 17:46:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898988#M355332</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2023-10-17T17:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: Rearrange  Variables in the same Column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898989#M355333</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 17:50:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rearrange-Variables-in-the-same-Column/m-p/898989#M355333</guid>
      <dc:creator>luvscandy27</dc:creator>
      <dc:date>2023-10-17T17:50:34Z</dc:date>
    </item>
  </channel>
</rss>

