datastep Questions - RunSubmit.com most recent 30 from http://www.runsubmit.com 2010-07-29T20:02:22Z http://www.runsubmit.com/feeds/tag/datastep http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://www.runsubmit.com/questions/325/data-step-code-for-metadata-administration Data step code for metadata administration SAS-L 2010-07-15T14:04:17Z 2010-07-15T14:04:17Z <p>I am trying to find and/or create some (presumably DATA Step) code to create a metadata folder under an existing metadata folder, inheriting all access rights. I'm sifting through the various Metadata manuals, but any assistance would be appreciated.</p> <p>Andrew Howell</p> http://www.runsubmit.com/questions/224/using-set-lists-i-e-set-dataset1-datasetn Using set lists (i.e. SET dataset1-datasetn ;)? JimOrrell 2010-03-17T22:29:26Z 2010-06-17T11:32:53Z <p>in the documentation it says this about the "SET" statement: </p> <blockquote> <p>Using Data Set Lists with SET...</p> <p>You can use data set lists with the SET statement....</p> <p>For example, set SALES1:; tells SAS to read all data sets starting with "SALES1" such as SALES1, SALES10, SALES11, and SALES12</p> <p>... [and] ...</p> <p>For example, these lists refer to the same data sets: </p> <p>sales1 sales2 sales3 sales4</p> <p>sales1-sales4...</p> </blockquote> <p>However, I'm getting an error when I use this:</p> <pre><code>data MyFile1; input name $ dept $; datalines; John Sales Mary Acctng ; data MyFile2; input name $ dept $; datalines; Jim Reporting Steven Acctng ; data combine; set MyFile: ; run; data combine; set MyFile1-MyFile2; run; </code></pre> <p>and the error looks like this:</p> <pre><code>28 data combine; 29 set MyFile: ; _ 22 _ 200 ERROR: File WORK.MYFILE.DATA does not exist. ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, ;, END, KEY, KEYS, NOBS, OPEN, POINT, _DATA_, _LAST_, _NULL_. ERROR 200-322: The symbol is not recognized and will be ignored. </code></pre> <p>or this:</p> <pre><code>32 data combine; 33 set MyFile1-MyFile2; _ 22 _______ 202 ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, ;, END, KEY, KEYS, NOBS, OPEN, POINT, _DATA_, _LAST_, _NULL_. ERROR 202-322: The option or parameter is not recognized and will be ignored. </code></pre> <p>I'm running v9.01 on UNIX Is this a version or an option thing?</p> <p>Jim</p> http://www.runsubmit.com/questions/185/theta-symbol-in-a-sas-label Theta Symbol in a SAS Label? SAS-L 2010-01-04T19:58:58Z 2010-01-05T02:55:45Z <p>How do I make the label for a variable display a Greek character. </p> <p>So I need:</p> <pre><code>label Theta = &lt;somehex_expression?&gt;; </code></pre> <p>I'm trying to label the variable named Theta with the upper case Greek theta symbol. thoughts?</p> http://www.runsubmit.com/questions/45/how-to-create-a-listing-of-all-intervening-dates-between-a-start-and-end-date How to create a listing of all intervening dates between a start and end date? Moderator 2009-10-22T10:39:18Z 2009-10-31T13:26:29Z <p>I have the following code where I have a tradid with the first date when the trade was opened and the second date when it was closed (as shown in the code below). </p> <pre><code>Data new; Infile cards; input tradeid $8. Date anydtdte20.; format date ddmmyy10.; datalines; 10392867 26Mar04 10392867 30Mar04 10433324 29Mar04 10433324 2Apr04 10448117 30Mar04 10448117 2Apr04 RUN; </code></pre> <p>I need to have output that inserts the dates that occur inbeween the dates I have in the data new file. Results would need to look like this (I inserted spaces between tradeid's for illustrative purposes only - same for the above): </p> <pre><code>tradeid Date ----------- --------- 10392867 26-Mar-04 10392867 27-Mar-04 10392867 28-Mar-04 10392867 29-Mar-04 10392867 30-Mar-04 10433324 29-Mar-04 10433324 30-Mar-04 10433324 31-Mar-04 10433324 1-Apr-04 10433324 2-Apr-04 10448117 30-Mar-04 10448117 31-Mar-04 10448117 1-Apr-04 10448117 2-Apr-04 10448117 3-Apr-04 10448117 4-Apr-04 </code></pre> http://www.runsubmit.com/questions/23/selecting-just-numeric-or-character-variables Selecting just Numeric or Character variables? Moderator 2009-10-20T16:17:54Z 2009-10-21T02:19:52Z <p>Can anyone please tell me how to select only numeric or character variables?</p>