<?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: To get an output by removing spaces in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/To-get-an-output-by-removing-spaces/m-p/748402#M235062</link>
    <description>&lt;P&gt;&lt;U&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/244224"&gt;@Sultana&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;/U&gt;As I understand from the previous post, you are importing csv files. The last variable is a character variable and it has space in between. For this reason your are not able to see the last variable.&lt;BR /&gt;I have converted your excel to csv and it can be imported without any issue.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import datafile="/path_to_your_file/Sample_sas.csv" out=sample_sas replace;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The output will be like this&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sajid01_0-1623864928830.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60430iB8E3A3169B9D30C5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sajid01_0-1623864928830.png" alt="Sajid01_0-1623864928830.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In case you want to read csv data inline you can use the following code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
length ID Status Category $ 25;
INFILE datalines DSD DLM=','  missover;
input ID $ Status $  Category  $;
datalines;
123-45-678,Active,FDI - UNION
678-90-111,Terminated,FT - Full Time
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The output will be same as in the first case.&lt;BR /&gt;In this later case you need to specify the length of the categorical variables if they are longer than eight characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 16 Jun 2021 17:41:36 GMT</pubDate>
    <dc:creator>Sajid01</dc:creator>
    <dc:date>2021-06-16T17:41:36Z</dc:date>
    <item>
      <title>To get an output by removing spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/To-get-an-output-by-removing-spaces/m-p/747910#M234823</link>
      <description>&lt;P&gt;I am providing a sample excel where the category section is not coming in the output as there are spaces.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the different functions but I think missing something. can someone please let me know how to get the output?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jun 2021 18:47:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/To-get-an-output-by-removing-spaces/m-p/747910#M234823</guid>
      <dc:creator>Sultana</dc:creator>
      <dc:date>2021-06-14T18:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: To get an output by removing spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/To-get-an-output-by-removing-spaces/m-p/747918#M234825</link>
      <description>Please provide more information. Remember we can see only what you post. It's usually a good idea to start with what you have (your input), what you want (your output) and what you've tried so far. &lt;BR /&gt;&lt;BR /&gt;I can see your output but not what you want or start with so right now, I have no idea what issue you're trying to solve.</description>
      <pubDate>Mon, 14 Jun 2021 19:02:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/To-get-an-output-by-removing-spaces/m-p/747918#M234825</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-06-14T19:02:39Z</dc:date>
    </item>
    <item>
      <title>Re: To get an output by removing spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/To-get-an-output-by-removing-spaces/m-p/747928#M234828</link>
      <description>I have provided my input file only thing is I use the CSV file and want&lt;BR /&gt;this to be in SAS EG output. But when I put in&lt;BR /&gt;&lt;BR /&gt;Input 1d : $12.&lt;BR /&gt;Status : $2&lt;BR /&gt;Category : $25&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;So the category column is coming as empty no output.&lt;BR /&gt;&lt;BR /&gt;I need the FDI - UNION and FT - Full Time to be reflected in the category&lt;BR /&gt;column.&lt;BR /&gt;&lt;BR /&gt;Please suggest&lt;BR /&gt;</description>
      <pubDate>Mon, 14 Jun 2021 19:18:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/To-get-an-output-by-removing-spaces/m-p/747928#M234828</guid>
      <dc:creator>Sultana</dc:creator>
      <dc:date>2021-06-14T19:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: To get an output by removing spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/To-get-an-output-by-removing-spaces/m-p/747932#M234830</link>
      <description>&lt;P&gt;Can you just import the .csv file with proc import?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jun 2021 19:25:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/To-get-an-output-by-removing-spaces/m-p/747932#M234830</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2021-06-14T19:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: To get an output by removing spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/To-get-an-output-by-removing-spaces/m-p/747933#M234831</link>
      <description>&lt;P&gt;But you didn't post a CSV file.&amp;nbsp; You posted some XLSX file.&amp;nbsp; Does that file you posted have anything to do with the CSV file you started with.&amp;nbsp; Remember do NOT let Excel open a CSV file for you, it will make changes based on what it thinks the strings in the file mean.&amp;nbsp; Look at the CSV file with a text editor (or just dump a few lines to your SAS log with a simple data _null_ step).&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jun 2021 19:30:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/To-get-an-output-by-removing-spaces/m-p/747933#M234831</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-06-14T19:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: To get an output by removing spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/To-get-an-output-by-removing-spaces/m-p/747940#M234835</link>
      <description>Attaching a CSV file&lt;BR /&gt;</description>
      <pubDate>Mon, 14 Jun 2021 19:46:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/To-get-an-output-by-removing-spaces/m-p/747940#M234835</guid>
      <dc:creator>Sultana</dc:creator>
      <dc:date>2021-06-14T19:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: To get an output by removing spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/To-get-an-output-by-removing-spaces/m-p/747942#M234837</link>
      <description>&lt;P&gt;Still don't see a csv file.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jun 2021 19:54:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/To-get-an-output-by-removing-spaces/m-p/747942#M234837</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2021-06-14T19:54:21Z</dc:date>
    </item>
    <item>
      <title>Re: To get an output by removing spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/To-get-an-output-by-removing-spaces/m-p/747943#M234838</link>
      <description>Attachments via email are not supported, you need to add your attachment via the website.</description>
      <pubDate>Mon, 14 Jun 2021 19:54:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/To-get-an-output-by-removing-spaces/m-p/747943#M234838</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-06-14T19:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: To get an output by removing spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/To-get-an-output-by-removing-spaces/m-p/747985#M234859</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Input 1d : $12.
Status : $2
Category : $25
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;We'd definitely have to see your input file in order to help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just looking at your code, I don't see the INFILE statement.&amp;nbsp; The INFILE affects the behavior of the INPUT, so that would be important for us to see.&amp;nbsp; There are different ways to code this, but presumably it looks something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;INFILE My_File DSD DLM=',';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This may not be the problem because you're getting at least some input, but it helps if you show us all the related code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jun 2021 23:10:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/To-get-an-output-by-removing-spaces/m-p/747985#M234859</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-06-14T23:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: To get an output by removing spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/To-get-an-output-by-removing-spaces/m-p/748402#M235062</link>
      <description>&lt;P&gt;&lt;U&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/244224"&gt;@Sultana&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;/U&gt;As I understand from the previous post, you are importing csv files. The last variable is a character variable and it has space in between. For this reason your are not able to see the last variable.&lt;BR /&gt;I have converted your excel to csv and it can be imported without any issue.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import datafile="/path_to_your_file/Sample_sas.csv" out=sample_sas replace;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The output will be like this&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sajid01_0-1623864928830.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60430iB8E3A3169B9D30C5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sajid01_0-1623864928830.png" alt="Sajid01_0-1623864928830.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In case you want to read csv data inline you can use the following code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
length ID Status Category $ 25;
INFILE datalines DSD DLM=','  missover;
input ID $ Status $  Category  $;
datalines;
123-45-678,Active,FDI - UNION
678-90-111,Terminated,FT - Full Time
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The output will be same as in the first case.&lt;BR /&gt;In this later case you need to specify the length of the categorical variables if they are longer than eight characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2021 17:41:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/To-get-an-output-by-removing-spaces/m-p/748402#M235062</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2021-06-16T17:41:36Z</dc:date>
    </item>
  </channel>
</rss>

