<?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: SAS Datastep in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Datastep/m-p/63792#M18127</link>
    <description>Your code does nothing but read in data and print it (it also looks like that proc sort would fail).  There is no creation of a file that holds both periods.&lt;BR /&gt;
&lt;BR /&gt;
You need to take an hour or two and study the set and merge statements and see what each does.  If you did that then you wouldn't have nearly half as many questions as you do.</description>
    <pubDate>Tue, 02 Mar 2010 21:44:53 GMT</pubDate>
    <dc:creator>RickM</dc:creator>
    <dc:date>2010-03-02T21:44:53Z</dc:date>
    <item>
      <title>SAS Datastep</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Datastep/m-p/63791#M18126</link>
      <description>Hello I need to obtain a single sas file which has all the periods Period 1 and Period2 ( period 2A + Period2B ).&lt;BR /&gt;
&lt;BR /&gt;
	                        Period 1	        Period 2A	         Period 2B&lt;BR /&gt;
Variable	            	COLUMNS	COLUMNS	COLUMNS&lt;BR /&gt;
Transaction ID     	1 – 8	                 1 – 8	         1 – 8&lt;BR /&gt;
Date of Sale		9 – 18	         9 – 18	&lt;BR /&gt;
Time of Sale		19 – 26		                           9 – 16&lt;BR /&gt;
Laptop Model		27 – 32	        19 – 24	&lt;BR /&gt;
Units Sold		         33 – 35	         25 – 27	&lt;BR /&gt;
Warranty	                  36	                      28	&lt;BR /&gt;
&lt;BR /&gt;
I've used the code - &lt;BR /&gt;
&lt;BR /&gt;
libname sc 'c:\Sas';&lt;BR /&gt;
data   period1;&lt;BR /&gt;
	infile 'c:\Sas\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 print data = period1;&lt;BR /&gt;
TITLE 'period1 sales';&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data  	period2A;&lt;BR /&gt;
	infile 'c:\Sas\period2_sales_data_A.dat.';&lt;BR /&gt;
	Input 	TransactionID $1-8&lt;BR /&gt;
			DateofSale    $9-18&lt;BR /&gt;
			LapstopModel  $19-24  &lt;BR /&gt;
			UnitsSold	   25-27&lt;BR /&gt;
			Warranty       28    ;&lt;BR /&gt;
proc print data=period2A;&lt;BR /&gt;
TITLE 'period2A sales';&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data    period2B;&lt;BR /&gt;
	infile 'c:\Sas\period2_sales_data_B.dat';&lt;BR /&gt;
	Input TransactionID   	  	$1-8&lt;BR /&gt;
&lt;BR /&gt;
	      TimeofSale	        $9-16;&lt;BR /&gt;
Proc sort data = period2_sales_data_B;&lt;BR /&gt;
	By TransactionID;&lt;BR /&gt;
proc print data=period2B;&lt;BR /&gt;
TITLE 'period2B sales';&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Using the above code craetes two columns of the Laptop model , when one column ends at some point the data remaining is printed on the second column. I think that i need to change the oredr of the input variables in data setp.&lt;BR /&gt;
&lt;BR /&gt;
Kindly  guide,&lt;BR /&gt;
markc</description>
      <pubDate>Tue, 02 Mar 2010 21:20:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Datastep/m-p/63791#M18126</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-03-02T21:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Datastep</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Datastep/m-p/63792#M18127</link>
      <description>Your code does nothing but read in data and print it (it also looks like that proc sort would fail).  There is no creation of a file that holds both periods.&lt;BR /&gt;
&lt;BR /&gt;
You need to take an hour or two and study the set and merge statements and see what each does.  If you did that then you wouldn't have nearly half as many questions as you do.</description>
      <pubDate>Tue, 02 Mar 2010 21:44:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Datastep/m-p/63792#M18127</guid>
      <dc:creator>RickM</dc:creator>
      <dc:date>2010-03-02T21:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Datastep</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Datastep/m-p/63793#M18128</link>
      <description>The previous suggestions from your posts to read about SET/MERGE by BY as well as taking consideration with using SAS numeric variables for DATE and TIME type references has either been ignored or forgotten.  &lt;BR /&gt;
&lt;BR /&gt;
Individuals on these forums take the time to address the requests for help/guidance, only to find that a subsequent post continues with disregard to others' feedback.&lt;BR /&gt;
&lt;BR /&gt;
Furthermore, as has been suggested, investing in time for self-checking of your program and the logs will go far to help one absorb useful habits when dealing with SAS program development and debugging.&lt;BR /&gt;
&lt;BR /&gt;
So, given the latest post and your point about multiple variables representing laptops, as I see it you have two SAS variables, one named LapstopModel and another called LaptopModel -- maybe intentional but who knows.  Also, your question is input data related and so you will be best suited to answer it, I believe, unless you are willing to generate SAS log diagnostics using commands, such as:&lt;BR /&gt;
&lt;BR /&gt;
LIST;&lt;BR /&gt;
&lt;BR /&gt;
putlog _infile_;&lt;BR /&gt;
&lt;BR /&gt;
putlog _all_;&lt;BR /&gt;
&lt;BR /&gt;
Again, to share only a non-working SAS program (as mentioned with the PROC SORT specification error), is not going to get you very far, in my experience.  In the future, share all of your SAS code but do so with a captured/pasted SAS log output with it.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Tue, 02 Mar 2010 22:29:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Datastep/m-p/63793#M18128</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-03-02T22:29:55Z</dc:date>
    </item>
  </channel>
</rss>

