<?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: Need Help with a complicated data step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298756#M62877</link>
    <description>&lt;P&gt;Something like this might work.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jim&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1.&amp;nbsp;&amp;nbsp;&amp;nbsp; Import the data&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2.&amp;nbsp;&amp;nbsp; eliminate blank lines,&amp;nbsp; non data lines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want; &amp;nbsp; set;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;rowcnt+1;&lt;/P&gt;
&lt;P&gt;/*&amp;nbsp; repeat for all 10 questions&amp;nbsp;&amp;nbsp;&amp;nbsp; */;&lt;/P&gt;
&lt;P&gt;t1+ans1;&amp;nbsp;&amp;nbsp;&amp;nbsp; t2+ans2;&amp;nbsp;&amp;nbsp; t3+ans3;&amp;nbsp;&amp;nbsp; .............. &amp;nbsp; /*&amp;nbsp; sum answers;&amp;nbsp; */;&lt;/P&gt;
&lt;P&gt;if agent=:'subtot'&amp;nbsp; then do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ans1=.&amp;nbsp; then ans1=t1/rowcnt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ans2=.&amp;nbsp; then ans2=t2/rowcnt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ans3=.&amp;nbsp; then ans3=t3/rowcnt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ans10=.&amp;nbsp; then ans10=t10/rowcnt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; ans1=0;&amp;nbsp;&amp;nbsp; ans2=0;&amp;nbsp;&amp;nbsp; ans3=0; ........rowcnt=0;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if last.question then do;&amp;nbsp;&amp;nbsp; output;&amp;nbsp;&amp;nbsp; count=0;&amp;nbsp; end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc print;&amp;nbsp; id agent question;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Sep 2016 19:07:29 GMT</pubDate>
    <dc:creator>Jim_G</dc:creator>
    <dc:date>2016-09-15T19:07:29Z</dc:date>
    <item>
      <title>Need Help with a complicated data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298442#M62766</link>
      <description>&lt;P&gt;Hi All!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need some help! &amp;nbsp;I am feeling not so smart right now. &amp;nbsp;I don't know where to even begin... and that is why i am reaching out to the SAS community.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am in the process of building a report to capture data ftrom a 3rd party vendor. &amp;nbsp;With this vendor i have to download the file in CSV format (I have attached a copy of the raw data that is dumped from their system).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The report is survey data... so the subtotals currently existing in row 15 of the CSV for example, In C15 of the CSV, it shows 9.833... what i need SAS to do.. is count the # of survey's in B15... so count basically everything that has a 1-10 in that section so i have a total count of survey's. &amp;nbsp;The Same thing across the subtotal line ofr all the questions.... so instead of a blank cell... i want SAS to count the applicable rows to show me a number. &amp;nbsp;There are 5 questions total that i need to do this on.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For some background... the names and line numbers will change daily... they will never be static.. .because different agents work everyday and one agent can get more or less than the day before.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone see if they can take a stab at this and see if you can possible help me here?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;DZ&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2016 20:57:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298442#M62766</guid>
      <dc:creator>D_Z_</dc:creator>
      <dc:date>2016-09-14T20:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with a complicated data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298443#M62767</link>
      <description>&lt;P&gt;I re-read my post and i better clarify.. i don't want to send info back to excel.. but i want the calculations to be done in SAS directly... i used the cells in the attached file for reference only.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2016 21:00:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298443#M62767</guid>
      <dc:creator>D_Z_</dc:creator>
      <dc:date>2016-09-14T21:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with a complicated data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298444#M62768</link>
      <description>&lt;P&gt;1. What do you want as output?&lt;/P&gt;
&lt;P&gt;2. Please post a CSV instead of xls, use the txt extension&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may have to read it all in as text or do a conditional read in, but generally well formatted. The comments may be an issue, it depends on how the software exports them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2016 21:06:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298444#M62768</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-14T21:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with a complicated data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298446#M62769</link>
      <description>&lt;P&gt;On the SAS output... i want SAS to put out the subtotal line for each agent... and the # of survey's with the score that is already there for all 5 questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have attached the .txt file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DZ&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2016 21:12:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298446#M62769</guid>
      <dc:creator>D_Z_</dc:creator>
      <dc:date>2016-09-14T21:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with a complicated data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298458#M62772</link>
      <description>Do you have a program that reads this data successfully? It does not look like a CSV file to me.&lt;BR /&gt; &lt;BR /&gt;cynthia</description>
      <pubDate>Wed, 14 Sep 2016 22:42:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298458#M62772</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-09-14T22:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with a complicated data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298459#M62773</link>
      <description>Yes... that's beause someone asked for it as a text file... if you look at the original xls file... that is exactly how the data looks in .csv format.  I already have a import process that works just fine to bring the data into the system.&lt;BR /&gt;&lt;BR /&gt;DZ</description>
      <pubDate>Wed, 14 Sep 2016 22:51:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298459#M62773</guid>
      <dc:creator>D_Z_</dc:creator>
      <dc:date>2016-09-14T22:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with a complicated data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298466#M62774</link>
      <description>&lt;P&gt;Ok. Well let's not recreate the wheel.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why not start off with the file you've already imported. Try attaching that as a zip or search on here how,to,create a datastep out of it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2016 23:55:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298466#M62774</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-14T23:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with a complicated data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298467#M62775</link>
      <description>&lt;P&gt;Ok. Well let's not recreate the wheel.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why not start off with the file you've already imported. Try attaching that as a zip or search on here how,to,create a datastep out of it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2016 23:55:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298467#M62775</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-14T23:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with a complicated data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298530#M62802</link>
      <description>&lt;P&gt;Post the original CSV file instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- nobody in his right mind opens Excel files from the web&lt;/P&gt;
&lt;P&gt;- we can that exactly recreate the steps you need to do to arrive at your intended result&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2016 06:54:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298530#M62802</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-09-15T06:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with a complicated data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298673#M62842</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/9120"&gt;@D_Z_&lt;/a&gt; wrote:&lt;BR /&gt;Yes... that's beause someone asked for it as a text file... if you look at the original xls file... that is exactly how the data looks in .csv format. I already have a import process that works just fine to bring the data into the system.&lt;BR /&gt;&lt;BR /&gt;DZ&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If I get a csv file, open in Excel and then save as Xls or xlsx, I seldom have exactly what was in the csv file. Excel will "helpfully" change some values into dates that shouldn't be, remove leading zeroes and I suspect other things that I have not discovered yet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2016 15:05:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298673#M62842</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-09-15T15:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with a complicated data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298675#M62844</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/9120"&gt;@D_Z_&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;On the SAS output... i want SAS to put out the subtotal line for each agent... and the # of survey's with the score that is already there for all 5 questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have attached the .txt file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DZ&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Personally I would go back to the survey vendor and get a data file and not a report file. Especially since I don't see how those "subtotals" reflect the "values" above them.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2016 15:09:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298675#M62844</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-09-15T15:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with a complicated data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298676#M62845</link>
      <description>&lt;P&gt;I get that... however.. .this board won't let me send a .csv file. &amp;nbsp; So I cannot send it... its not the import i am looking for help on... its the data step... everyone is hung up on the actual import... but what i am looking to do is a datastep to add up the # of survey's in between the intial name and subset of "namd"... When i open the CSV file.. the general format is exactly the same as the .xls file i uploaded to begin with. &amp;nbsp;I can't send it up in the format i am uploading in... it won't let me... it throws an error and tells me that it won't accept the file type and takes the attachment out.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2016 15:10:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298676#M62845</guid>
      <dc:creator>D_Z_</dc:creator>
      <dc:date>2016-09-15T15:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with a complicated data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298715#M62857</link>
      <description>Going back to the survey vendor is not possible.. .already have tried... so back to my original question... is there a way to have SAS count the # of instances in the BLANK subtotal cells... ?</description>
      <pubDate>Thu, 15 Sep 2016 16:25:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298715#M62857</guid>
      <dc:creator>D_Z_</dc:creator>
      <dc:date>2016-09-15T16:25:42Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with a complicated data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298756#M62877</link>
      <description>&lt;P&gt;Something like this might work.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jim&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1.&amp;nbsp;&amp;nbsp;&amp;nbsp; Import the data&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2.&amp;nbsp;&amp;nbsp; eliminate blank lines,&amp;nbsp; non data lines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want; &amp;nbsp; set;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;rowcnt+1;&lt;/P&gt;
&lt;P&gt;/*&amp;nbsp; repeat for all 10 questions&amp;nbsp;&amp;nbsp;&amp;nbsp; */;&lt;/P&gt;
&lt;P&gt;t1+ans1;&amp;nbsp;&amp;nbsp;&amp;nbsp; t2+ans2;&amp;nbsp;&amp;nbsp; t3+ans3;&amp;nbsp;&amp;nbsp; .............. &amp;nbsp; /*&amp;nbsp; sum answers;&amp;nbsp; */;&lt;/P&gt;
&lt;P&gt;if agent=:'subtot'&amp;nbsp; then do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ans1=.&amp;nbsp; then ans1=t1/rowcnt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ans2=.&amp;nbsp; then ans2=t2/rowcnt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ans3=.&amp;nbsp; then ans3=t3/rowcnt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ans10=.&amp;nbsp; then ans10=t10/rowcnt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; ans1=0;&amp;nbsp;&amp;nbsp; ans2=0;&amp;nbsp;&amp;nbsp; ans3=0; ........rowcnt=0;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if last.question then do;&amp;nbsp;&amp;nbsp; output;&amp;nbsp;&amp;nbsp; count=0;&amp;nbsp; end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc print;&amp;nbsp; id agent question;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2016 19:07:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298756#M62877</guid>
      <dc:creator>Jim_G</dc:creator>
      <dc:date>2016-09-15T19:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with a complicated data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298824#M62898</link>
      <description>&lt;P&gt;That is a pretty simple file to read. Normal report type layout.&lt;/P&gt;
&lt;P&gt;You need to read the first column (or two) and check whether you are reading the report heading, patient heading, sub total or total lines. &amp;nbsp;You can then read the rest of the row based on what type of row it is.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the values that you read from the header lines save them into variables that you retain.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you read in a detail line the OUTPUT the line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You probably do not need to read the sub total and total lines since you should be able to calculate them from the detail lines. &amp;nbsp;But if you did then just read them and write the to a different dataset. &amp;nbsp;Looks like they are not "sub-totals" but actually means.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  infile "&amp;amp;path/&amp;amp;fname" dsd dlm='09'x truncover  ;
  length Department Person $100 ;
  length rowid 8 answer1 value1 answer2 value2
                 answer3 value3 answer4 value4 8
                 answer5 value5list $30 value5 8 answer6 $30
  ;
  length Questionnaire DateRange ReportDate $100 ;
  length x1 x2 $2000 ;
  retain Questionnaire DateRange ReportDate Department Person ;
  input x1 x2 @1 @ ;
  if _n_=1 then do;
    input / Questionnaire / DateRange / ReportDate ;
  end;
  if x1 = ' ' or x2='Answer chosen for #1' or x1='Total' then delete;
  else if x1=: 'Subtotal' then do;
    if person=' ' then Department=' ';
    else Person=' ';
  end;
  else if x2=' ' then do;
    if Department = ' ' then input Department;
    else input Person ;
  end;
  else do ;
    input rowid -- answer6;
    output ;
  end;
  drop x1 x2 ;
run;

proc print ;
  by Department Person notsorted;
  id rowid ;
  var answer1 -- answer6 ;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/4932iD0C23308CFBA48B6/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="Capture.PNG" title="Capture.PNG" /&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2016 00:40:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298824#M62898</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-09-16T00:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with a complicated data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298907#M62938</link>
      <description>Does this not need a simple proc print with a SUM statement&lt;BR /&gt;Or is it time for a tabulate to show just those summary totals&lt;BR /&gt;??</description>
      <pubDate>Fri, 16 Sep 2016 10:43:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/298907#M62938</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2016-09-16T10:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with a complicated data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/299202#M63037</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/9120"&gt;@D_Z_&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I get that... however.. .this board won't let me send a .csv file. &amp;nbsp; So I cannot send it... its not the import i am looking for help on... its the data step... everyone is hung up on the actual import... but what i am looking to do is a datastep to add up the # of survey's in between the intial name and subset of "namd"... When i open the CSV file.. the general format is exactly the same as the .xls file i uploaded to begin with. &amp;nbsp;I can't send it up in the format i am uploading in... it won't let me... it throws an error and tells me that it won't accept the file type and takes the attachment out.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If your import is already working, then post a sample of your dataset as a data step with datalines:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;That way you only have to copy/paste text, not upload a file.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2016 05:40:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-a-complicated-data-step/m-p/299202#M63037</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-09-19T05:40:34Z</dc:date>
    </item>
  </channel>
</rss>

