<?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 SAS Code in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Code/m-p/59420#M16771</link>
    <description>Hello ,&lt;BR /&gt;
&lt;BR /&gt;
When i run the code below i get message that the WORK.PERIOD2A.DATA does not exist . could you suggest please what  mistake i'm doing.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
libname example 'c:\SAS' ;&lt;BR /&gt;
data  sc.period2A;&lt;BR /&gt;
	infile 'c:\Cwa\period2_sales_data_A.dat';&lt;BR /&gt;
	Input 	TransactionID $1-8&lt;BR /&gt;
			DateofSale	  $9-18&lt;BR /&gt;
			LaptopModel   $19-24&lt;BR /&gt;
			UnitsSold      25-27&lt;BR /&gt;
			Warranty       28;&lt;BR /&gt;
Proc Sort Data = period2A;&lt;BR /&gt;
	By TransactionID;&lt;BR /&gt;
proc print data=period2A;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
I want to save the sorted dataset in the C file. &lt;BR /&gt;
&lt;BR /&gt;
kind  regards ,&lt;BR /&gt;
&lt;BR /&gt;
siddharth</description>
    <pubDate>Thu, 18 Feb 2010 15:40:49 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-02-18T15:40:49Z</dc:date>
    <item>
      <title>SAS Code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Code/m-p/59420#M16771</link>
      <description>Hello ,&lt;BR /&gt;
&lt;BR /&gt;
When i run the code below i get message that the WORK.PERIOD2A.DATA does not exist . could you suggest please what  mistake i'm doing.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
libname example 'c:\SAS' ;&lt;BR /&gt;
data  sc.period2A;&lt;BR /&gt;
	infile 'c:\Cwa\period2_sales_data_A.dat';&lt;BR /&gt;
	Input 	TransactionID $1-8&lt;BR /&gt;
			DateofSale	  $9-18&lt;BR /&gt;
			LaptopModel   $19-24&lt;BR /&gt;
			UnitsSold      25-27&lt;BR /&gt;
			Warranty       28;&lt;BR /&gt;
Proc Sort Data = period2A;&lt;BR /&gt;
	By TransactionID;&lt;BR /&gt;
proc print data=period2A;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
I want to save the sorted dataset in the C file. &lt;BR /&gt;
&lt;BR /&gt;
kind  regards ,&lt;BR /&gt;
&lt;BR /&gt;
siddharth</description>
      <pubDate>Thu, 18 Feb 2010 15:40:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Code/m-p/59420#M16771</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-02-18T15:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Code/m-p/59421#M16772</link>
      <description>You create sc.period2A but I do not see where you create period2A.&lt;BR /&gt;
So it does not exist.&lt;BR /&gt;
Do you have a library sc defined, it is not in this code.&lt;BR /&gt;
&lt;BR /&gt;
Also put in some run; statements and you will have better luck reading your log.</description>
      <pubDate>Thu, 18 Feb 2010 15:53:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Code/m-p/59421#M16772</guid>
      <dc:creator>Flip</dc:creator>
      <dc:date>2010-02-18T15:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Code/m-p/59422#M16773</link>
      <description>Hello ,&lt;BR /&gt;
&lt;BR /&gt;
thank you for the suggestion. I changed the code as :&lt;BR /&gt;
&lt;BR /&gt;
libname sc 'c:\Cwa';&lt;BR /&gt;
data  period1;&lt;BR /&gt;
	infile 'c:\Cwa\period1_sales_data.dat';&lt;BR /&gt;
	Input 	TransactionID $1-8&lt;BR /&gt;
			DateofSale	  $9-18&lt;BR /&gt;
			TimeofSale    $19-26&lt;BR /&gt;
			LaptopModel   $27-32&lt;BR /&gt;
			UnitsSold      33-35&lt;BR /&gt;
			Warranty	   36;&lt;BR /&gt;
proc sort data = period1;&lt;BR /&gt;
	By DateofSale;&lt;BR /&gt;
proc print data = period1;&lt;BR /&gt;
title 'period 1 Sales ';&lt;BR /&gt;
RUN;&lt;BR /&gt;
	&lt;BR /&gt;
I get the sorted output in the output window when i use above code then i add sc in the data line and then rerun the code to save the permannent file of sorted ( by date of sale ) file. but when i open the file i dont get the data in sorted format .&lt;BR /&gt;
&lt;BR /&gt;
Kindly  guide.&lt;BR /&gt;
&lt;BR /&gt;
regrards ,&lt;BR /&gt;
&lt;BR /&gt;
markc</description>
      <pubDate>Thu, 18 Feb 2010 16:22:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Code/m-p/59422#M16773</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-02-18T16:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Code/m-p/59423#M16774</link>
      <description>You need to output the sorted data to the permanent lib.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
proc sort data = period1 out = sc.period1;&lt;BR /&gt;
By DateofSale;&lt;BR /&gt;
RUN;</description>
      <pubDate>Thu, 18 Feb 2010 16:39:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Code/m-p/59423#M16774</guid>
      <dc:creator>Flip</dc:creator>
      <dc:date>2010-02-18T16:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Code/m-p/59424#M16775</link>
      <description>Hello ,&lt;BR /&gt;
&lt;BR /&gt;
I used the code &lt;BR /&gt;
&lt;BR /&gt;
libname sc'c:\Cwa';&lt;BR /&gt;
data  period2A;&lt;BR /&gt;
	infile 'c:\Cwa\period2_sales_data_A.dat';&lt;BR /&gt;
	Input 	TransactionID $1-8&lt;BR /&gt;
			DateofSale	  $9-18&lt;BR /&gt;
			LaptopModel   $19-24&lt;BR /&gt;
			UnitsSold      25-27&lt;BR /&gt;
			Warranty       28;&lt;BR /&gt;
proc sort data = period2Aout = sc.period2A;&lt;BR /&gt;
By DateofSale;&lt;BR /&gt;
RUN;&lt;BR /&gt;
proc print data = period2A;&lt;BR /&gt;
title 'period 2A Sales ';&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
but it didnt work .Do i need to change the format of date in the input &lt;BR /&gt;
&lt;BR /&gt;
.The date is in  format :17/11/2009&lt;BR /&gt;
Any chage would you recommend in the date format to use proc sort .I used date as a character $ variable .&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
kind  reagards ,&lt;BR /&gt;
&lt;BR /&gt;
mark</description>
      <pubDate>Thu, 18 Feb 2010 17:26:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Code/m-p/59424#M16775</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-02-18T17:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Code/m-p/59425#M16776</link>
      <description>Rather than just saying "it didn't work" you should include the relevant portion of the SAS log.&lt;BR /&gt;
&lt;BR /&gt;
if that is the exact code used then you need a space between period2A and out= in:&lt;BR /&gt;
&lt;BR /&gt;
proc sort data = period2Aout = sc.period2A;&lt;BR /&gt;
&lt;BR /&gt;
This would likely cause SAS to not even run the proc sort.</description>
      <pubDate>Thu, 18 Feb 2010 19:11:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Code/m-p/59425#M16776</guid>
      <dc:creator>RickM</dc:creator>
      <dc:date>2010-02-18T19:11:50Z</dc:date>
    </item>
  </channel>
</rss>

