Re: How to filter sas data sets into separate sas data sets #4
Something like this is the old way. You could use a proc sql if you
have a new enough version. Increase your buffersize and if you have
enough memory you may get it into a hash routine.
MERGE small (IN=A OBS=500) big ;
From: SAS(r) Discussion [mailto:SAS-L@listserv.vt.edu] On Behalf Of
Sent: Monday, April 02, 2007 10:53 AM
Subject: How to filter sas data sets into separate sas data sets
This is my failing point in coding SAS. T...Re: How to filter sas data sets into separate sas data sets #3
Instead of trying to merge the two data sets, I would probably try to create
a SAS format from the values of VAR1 in data set 1. Then, NODE1, NODE2 and
NODE3 could be compared against the format for a match.
The example below is a simplified version of what you could do and shows a
printout of how it works. It has 5 observations in data set 1 and only 3
variables in data set 2, but I think the logic should hold for the example
you gave. After the example is code that could be used to actually split
the data as you had requested. Hope this helps.
* create sas data set 1 ;
data ...HELP: File XX is not a sas data set
I have a set of codes which i've been running for many times and
haven't had any problem. The codes include importing many CSV files.
Today all of a sudden, SAS couldn't import some of the CSV file. The
message is : File XX is not a SAS data set.
Have tried importing manually and SAS still couldn't import.
Yesterday after a few hours of running codes, SAS hang twice, and not
long after, Windows showed blue screen saying it's cleaning memory.
Could this errors be affected by it?
Thanks in advance.
...Re: Exporting a SAS data set to Text file on SAS unix #3
hi ... actually, what I posted earlier was too much code (sorry)
this is enough (a bit more succinct)
* variable names into a macro variable (tab separated);
proc sql noprint;
select name into :vars separated by '09'x
where libname eq 'SASHELP' and memname eq 'CLASS'
file 'z:\class.txt' dsd dlm='09'x ;
if _n_ eq 1 then put "&vars";
put (_all_) (:);
U@Albany School of Public Health
One University Place
Rensselaer, New York 12144-3456
P/518-402...Re: How to filter sas data sets into separate sas data s ets
I think that both Ron's (as he mentioned) and Richard solutions require that
VAR1 is in both datasets.
But from the original post, it seemed to me that VAR1 is only in data set 1,
and it must be matched to 1 of 3 variables in data set 2 (NODE1, NODE2 or
NODE3) to be output to the NEWLIST data set. For this reason, I think a
format is one possible approach.
Maybe the original poster can clarify this point. Thanks.
Center for Health Program Development and Management
University of Maryland, Baltimore County
From: SAS(r) Discussio...Re: search SAS data set from SAS code
> From: Rose
> Hi All,
> Suppose I have a sas permanent data set which was created
> early, I know
> the library path but I couldn't remember in which sas program code I
> created it. how can I search from so many sas program files in
> different folders and find it.
a problem familiar to all of us delayed-housekeeping folks.
Libname Libref '<directory-specification>';
use your system utilities to search for the dir-spec
of your libref.
containing text: <dir-spec>
once you have found the libname...Re: search SAS data set from SAS code #5
You have some good advice on search techniques, but they may beinadequate.
I hope your LIBNAME wasn't something like
libname lib "&dir" ;
Perhaps you should also search for ".member", but that also couldhave the same problem. You might also look for key variablenames or values, or procedures that you know created the data.The date from a PROC CONTENTs might provide useful information,or an old report created by the same program with a footnote,"Source code: ...".
data lib.w ( label="created by ..." ) ;
would be a good habit to ...Re: search SAS data set from SAS code #2
The answer to your question depends on your operating system. In Windows,
there's the Search tool. In Unix/Linux, you can use grep
240 314 4400 x1374
Sent by: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
04/19/2005 11:13 AM
Please respond to myr_rose
Subject: search SAS data set from SAS code
Suppose I have a sas permanent data set which was created early, I know
the library path but I couldn't remember in which s...Re: CSV file into SAS data set
You should be able to do this with more or less the same code, the only
differences being the DATAFILE= option and, possibly, the OUT= option. In
other words, you will need to specify the correct UNIX file name & path and
may need to specify a different library name. Otherwise, the code should be
Analytical Services Team
Tel +44 131 244 7237
**********************************************...Re: Reading & Writing SAS data sets without SAS #3
You're correct in that a number of companies have done it. I believe SPSS
can do it, WPS, Stat Transfer, dbmscopy, and perhaps others have also done
it. But what I think is unique about this is that Alan is talking about
offering plug-ins so you can roll-your-own so to speak. How cool would it be
to have some type of driver/plugin for R?
SAS & WPS Consulting and WPS Reseller
Tel: (614) 457-3714
From: Chang Chung [mailto:chang_y_chung@HOTMAIL.COM]
Sent: Monday...Re: Reading SAS data sets on UNIX by non-SAS apps #2
Following on Richard's thoughtful suggestions, the Affinium system would
likely capture data from csv files. SAS PROC EXPORT produces them quickly,
and loading them into external systems works faster for relatively basic
data structures and data formats, in my experience, than xml parsing.
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of John
Sent: Monday, October 18, 2004 10:10 AM
Subject: Reading SAS data sets on UNIX by non-SAS apps
I have SAS data sets on AIX that we need to read with Unica's Affinium
campaign management software, also on a UNIX box. (Let's not get into why
we didn't go with the SAS Solution.) SAS Institute doesn't supply an ODBC
driver for the UNIX environment, and the Affinium implementors don't want to
use the SAS SQL Library for C and or deal with APIs. Other that dumping the
SAS data sets as flat files, can anyone suggest a solution?
Thanks in advance for the help.
...Re: What r the data types in SAS? in Base SAS , and SAS SQL
> From: Amar Mundankar
> Sent: Tuesday, July 21, 2009 8:10 AM
> To: email@example.com
> Subject: What r the data types in SAS? in Base SAS , and SAS SQL
> Hi all,
> What are the different data types in Base SAS and SAS SQL??
character, lengths from 1 to 32,000+
numeric: lengths from 2 to 8
dates are a subtype of numeric
and are identified by their date, datetime, or time formats
the new proc TSPL (Table Server Processing Language)
supports ANSI data types: bigint, tinyint, etc.
http://s...Re: converting a SAS data set to a CSV file
For csv proc export,
...Re: reading in txt file to sas data set
On Mon, 6 Dec 2004 16:33:59 -0800, bw <bcwache@GMAIL.COM> wrote:
>I'm trying to read in a .txt file that is structured like this:
>Az: .0000 12.00 24.00
>.00 .4645 1.742 15
>90. .4052 1.035 16
>.00 .0000 .2742 26
>.90 .0000 .2576 27
>I'd like the resulting sas data set to have 4 variables and 6
>observations like this:
>az in CEA CIE
>.0000 .00 .4645 .0000
>12.00 .00 1.742 .2742
>24.00 .00 15 26
>.0000 90. .4052 .0000
>12.00 90. 1.035 .2576
>24.00 ...Re: UNIX file permissions for SAS data sets
Thank you for the information about umask. Indeed, the two servers do have
different umask values. The first one, which allows others to read the SAS
data sets, has umask value of 022; the second one, which does not allow
others to read SAS data sets, has umask value of 077. I tried two
experiments. I telneted to the second UNIX server and issued the
command "umask 022." This did change the umask value to 022. However, SAS
data sets created via remote submission still came out with permission -rw--
-----. I also issued the command "%sysexec umask 022;" ...Re: UNIX file permissions for SAS data sets #2
Hi, Richard and everyone.
I called SAS Tech Support (919-677-8008) and got the following suggestion,
very similar to what you told me in a private communication. They
suggested editing the SAS/CONNECT script file tcpunix.scr, adding a line to
set the umask right before it issues the SAS command on the remote host,
type 'umask 022' LF;
type 'sas -dmr...
In this case, I am not using unxspawn for the remote SAS session. If I
were, I believe I would have to do what you suggested, which is to create a
shell script file with the umask command in it.
A co-worker suggested the...Re: converting a SAS data set to a CSV file #3
Exactly what happens (or doesn't happen)? "Doesn't work" is too vague to
Note that the EXT attachment option cannot in any way convert the content
of a file. It merely changes the name.
On Thu, 21 Jul 2005 11:52:46 +0200, spin0369 <spin0369@TISCALI.NL> wrote:
>Dear SAS users,
>With SAS8 I used :
>FILENAME MYFILE EMAIL "D.IANCU@BELASTINGDIENST.NL"
> SUBJECT="Weekrapportage CAV jobs "
> ATTACH =("ADCI.SMIV.SMF01002.EXT.CAVWXLS(+1)" EXT='CSV')
> ...Re: How to ombine multiple excel files into one sas data set
Dear prof. Zdeb,
Thanks a lot. Your method works very well! I added two more pieces:
1. source var indicate the source xls file for future QC,
2. Libname option: mixed = yes, because some of the column has both numeric and
One more question: this code is to read "sheet1", what can I do if each
spreadsheet has a different sheet name instead of sheet1?
From: Mike Zdeb [mailto:firstname.lastname@example.org]
Sent: Wednesday, December 17, 2008 9:30 AM
To: Zhang, Zibiao
Subject: Re: How to ombine multiple excel files into one sas data set
hi ... I do not think that this is as EASY as the various methods I showed with
regular data (maybe there is another way I do not know about)
if you have licensed SAS ACCESS to PC FILE FORMATS, this works
I made 3 small spreadsheets that all start with the letters SP (they are
I wrote a MACRO to read all the spreadsheets and append the data to one data set
some things to notice ...
I had to specify the FOLDER in the FILENAME statement and in the LIBNAME
the variable NAME in each spreadsheet was a different length so I added a LENGTH
statement in DATA TEST;
the XLS libname engine adds FORMATS to all variables, so I took off all the
formats in DATA TEST;
give it a try ... don't know if you ever used macros or if this is too advanced
for what you know about SAS
* a filename statement that looks at the directory of files in a folder;
filename dircmd pipe "dir /...Re: How to ombine multiple excel files into one sas data set #2
hi ... well, this makes the assumption that you have only one sheet with a name that is NOT "sheet1"
but given that assumption, I think this works OK (it did with some small tests)
the macro code looks for the name of a sheet that does not start with "SHEET"
if it finds one, it uses that name, otherwise it uses SHEET1
* just in case ... delete the data set ALLXLS from the WORK library;
proc datasets nolist;
* read the spreadsheet file names one at a time from the data set FILES;
%do j=1 %to &sheets;
set files point=rec;
use the libname engine to get at the data in the spreadsheet
append the data from each spreadsheet to a new data set named ALLXLS
libname x "z:\&spreadsheet";
proc contents data=x._all_ noprint out=xyz (keep=memname) ;
sheet = 'sheet1$';
do until (last or sheet ne : 'sheet');
set xyz end=last;
if upcase(memname) ne : 'SHEET' then sheet = memname;
proc append base=allxls data=x."&sheet."n force;
libname x clear;
U@Albany School of Public Health
One University Place
Rensselaer, New York 12144-3456
> Dear prof. Zdeb,
> Thanks a lot. Your method works very well! I added two more pieces:
> 1. source var indi...Re: Compressing data sets (was Re: [SAS-L])
On Mon, 5 Jan 2004 18:14:02 -0700, Jack Hamilton
>OK, "you or a program on your behalf will have to decompress them before
>Manager, Technical Development
>Metrics Department, First Health
>West Sacramento, California USA
>>>> "Richard Graham" <email@example.com> 01/05/2004 5:04 PM
>Actually you can compress(WINZIP, PKZIP) SAS data sets and use them in
>compressed format. There is software...Re: Compressing data sets (was Re: [SAS-L]) #2
OK, "you or a program on your behalf will have to decompress them before
Manager, Technical Development
Metrics Department, First Health
West Sacramento, California USA
>>> "Richard Graham" <firstname.lastname@example.org> 01/05/2004 5:04 PM
Actually you can compress(WINZIP, PKZIP) SAS data sets and use them in
compressed format. There is software named ZipMagic which allows zip
to be used as windows folders. I have done this with mixed results
underlying data set is upwards of 4GB. Bu...Re: SASTip104
liking this tip, I tried it, only to find it very useful
but I want more.
How can we persuade the links to work?
to invoke without scratching around for system path and sas root, use
windows command start to open explorer via registry
%sasroot% as the windows syntax to use an env var, like:
3 option noxsync noxwait;
4 x 'start explorer.exe ms-its:%sasroot%\core\help\fsp.chm::/fsp.hlp/a000007097.htm'
From: Phil Mason [mailto:email@example.com]
Sent: Mon 28/06/2004 09:03
Subject: SASTip104 - Findin...Re: XML data to SAS data set converstion #2
A correction. The initial post asked:
"Is it possible to convert an XML data to SAS data set without a SAS
If there is no SAS at all in a particular shop, then there is no way to do
this conversion. If access to SAS is available via IOM then there are ways.
What "environment" means becomes the question.
If a shop can simply convert into a compatible SAS XML format that is a
possibility. The other is to convert it into a delimited file or get it into
a database that a SAS shop can read.
The SAS dataset layout is binary and unknown. You could put it into a S...Re: Is there a system option for OpenVMS SAS version 8 where a sas program can create an output file with a file attribute of "Stream_LF" so that these external files c
Charles Patridge <charles_s_patridge@PRODIGY.NET> wrote:
> Is there a system option for OpenVMS SAS version 8 where a sas program
> create an output file with a file attribute of "Stream_LF" so that
> external files can be served through an Apache WebServer properly?
> Currently, what happens is when we create a CSV file, the Apache
> wants to load the contents of this CSV file into a single cell for
> That is, all OBS are treated as a SINGLE record and all the contents
> loaded into a single cell within Excel.