Re: combine n SAS datasets in to one SAS dataset.
If you use the dictionary tables try Proc SQL - it will run much more
quickly than a datastep:
proc sql noprint;
select MemName into :MemList
separated by " &lib.."
and MemName eqt upcase("&mem");
DDS Data Extraction
From: SAS(r) Discussion [mailto:SAS-L@L...Re: Deleting SAS Data from a SAS DATASET #4
Summary: PROC DATASETS; AGE statement. + VIEWs
This won't help you delete data from your very big data set, but you
may find this example interesting.
You say you append data monthly to a big data set then when big gets
too big you need to clean out the old. And that takes a very long
However if you don't physically append but use a view to
append/combine you may find it easier to get rid of the unwanted old
Consider this code. it pushes MonthlyUpdate onto the stack of 24 data
sets and the 24th data set is deleted. Then all the data sets get
renamed to produce a new g...Re: Storing SAS-programs and -macros in SAS-datasets on a HOST-platform #4
SI provide an example of using a sas catalog as if it were a pds
(as a "aggregate storage location"), in the onlinedoc at
(this is a 9.1.3 link, but the example is valid since before sas v8)
However, sas catalogs don't (neccessarily) make cross/platform
operations easier. A program is usually a lot smaller that the
space it takes up in a sas catalog as a source entry. If you have
a lot of programs, the proc upload or download time may become
less welcome ;-)
"Aggregate storage location&quo...Transposing a multivariate sas dataset into a multivariate sas dataset
I currently run this code to generate a report in Excel format for a
input lname $ label1 $ label2 $ label3 $ name $ var1 $ var2 $ var3 $;
Name label1 label2 label3 Johnny Jv1 Jv2 Jv3
ARRAY report (4) $ name var1 var2 var3;
ARRAY report2 (4) $ lname label1 label2 label3;
FILE 'c:/desktop/file.xls' dlm='09'x;
DO i=1 to 4;
put report2(i) report(i);
This is the output in the excel file:
My report has changed such that there will be multiple ...Re: SAS System Viewer 9.1 unable to open SAS datasets ( SAS 9.1.3)
A question in return:
is your table from windows? compressed from another system?
and specially with personnel formats hard coded inside?
msiddu2000 a �crit :
> SAS System Viewer 9.1 was able to open datasets that were created by
> V8 engine (SAS 8.2), but is unable to open datasets that are created
> with V9 engine (SAS 9.1.3).
> Does this need SAS System Viewer to be upgraded ?
> Something else needs to be done ?
INED (Institut National d'Etudes D�mographiques)
133 Boulevard Davout 75980 Paris Cedex 20
m�l : firstname.lastname@example.org t�l : 33 (0) 1 56 06 21 54
...Re: How to read a SAS log into a SAS dataset.
>Dear SAS-L listers,
>This may be the millionth time somebody is asking this question " how to
>read a SAS log into a SAS dataset?". I looked at previous posts and
>gathered info from various SUGI papers and found a way to get the log and
>read it. But i dont know for some reason its not working. Please help me.
>I used a Proc printto procedure to print the log to a external file
>location and try to read in the log and create a SAS dataset which will
>contain info about Filename, Owner name, Group name, Elapsed time, CPU
You should be able to find some info in the SPD Engine section of the
Sent: Mon, 3 Jul 2006 09:03:00 -0700
Subject: SAS - 9; Partition of SAS Datasets.
Recently I heared from some of my friends...that SAS - 9
supports PARTITION of SAS datasets. I tried for getting syntax and some
details, but couldn't able to get. Is anyone has any idea about the
partitions of SAS datasets, if so can any one help me out on this?
Thanks in advance.
_____...Re: converting sas transport files into sas datasets
Once you have assigned an xport libname you can read it in like a
libname out xport 'C:\Documents and Settings\kdt\Desktop\class.xpt';
*- Create xport file;
*- Create work file from xport file;
> Hello All,
> Could anyone please give me the code for converting sas transport
> files into sas datasets. thanks in advance.
...Re: Deleting SAS Data from a SAS DATASET #13
I am not expert with indexes, but I would expect that an index on each
data set would be employed even when the data are accessed through
a view. If that is correct, there would be clear advantage to indexing
data for each month separately. If the data are in one large file,
then when old data are deleted and new data added, the entire index
will need to be recreated on all of the data. That is a big operation.
If, instead, data are maintained in separate files for each month and
each month of data is indexed independently, then indexing needs to
be performed only for the new data. The ind...Re: Deleting SAS Data from a SAS DATASET #14
On Fri, 15 Aug 2008 18:54:08 -0400, Dave Scocca <dave@SCOCCA.ORG> wrote:
>--On 8/15/08 6:03 PM -0400 Chang Chung wrote:
>> good point! but as shown below, you can make a view of multiple datasets
>> having the separate indexes, and where seems to be fine with this.
>> interesting. ran on sas 9.1.3 sp4 on windows.
>> /* make a view of two datasets appended */
>> proc sql feedback;
>> drop view work.oneTwo;
>> create view oneTwo as
>> select * from one union select * from two
>> order by age;
>One thought on this--at least in my general approach to using views--is you
>probably want to avoid the ORDER BY statement--especially if it's the variable
>you're indexing on and you want to use a subset.
>For any amount of data above a trivial one, there's no sense in forcing the
>view to re-order th
>e data if it doesn't have to.
Eliminating ORDER BY is not going to do any good unless the ALL option is
invoked for the UNION operator. Otherwise the view is going to purge
duplicate rows, and will sort the rows to support that process. Ian
mentioned the ALL option but did not emphasize its importance.
...Re: Deleting SAS Data from a SAS DATASET #15
Summary: Suggestions for maintaining large data set
You are essentially making a copy of a 50GB file every month. Of
course, it takes long. Consequently you either have to copy the data
more efficiently or modify how the data is stored and/or used.
Have you looked at system options to make this as efficient as
possible? Big buffers, many buffers. Different disk handlers for
input and output would also speed up the process since it is mainly IO
bound. (These topics have been discussed on SAS-L, in papers, and
documentation. I have not found the techniques necessary...Re: Is it possible to read a sas dataset NOT using sas?
You might try the Universal OLE DB driver.
Docs at: http://tinyurl.com/2cmgcf
Driver page at: http://tinyurl.com/2hbc23
I think this should allow you to read a sas data set but not write to it.
Also, the driver does not support much beyond a Select * clause.
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Sent: Tuesday, March 18, 2008 9:44 AM
Subject: Is it possible to read a sas dataset NOT using sas?
Is it possible to read a sas dataset NOT using sas and have
observations an...Re: Deleting SAS Data from a SAS DATASET #17
When I used this code, I am receiving the following warning. It completely
deleted my prod.master_date SAS Dataset. Do you know what is going on here?
WARNING: This SAS global statement is not supported in PROC SQL. It has
On Fri, 15 Aug 2008 13:17:25 -0500, Mary <mlhoward@AVALON.NET> wrote:
>One thing you might do is to add an index on the snap_dt to the dataset;
if that's there then you should be able to delete the records in place:
> delete from prod.master_date;
> where snap_dt = "&end_dt"d;
&...Re: Deleting SAS Data from a SAS DATASET #16
Summary: SAS Scalable Performance Data Server
You now have a number of reasonable suggestions to your problem that
place the burden on the programmer, but I did not see mention of the
SAS Scalable Performance Data Server. This is a SAS product designed
to handle large amounts of data. Considering the size of your data
set suggests that perhaps it is time to spend money on the problem.
Even the SPDE engine included with the base product might help,
particularly if the computer has several CPUs.
Date: Fri, 15 Aug 2008 13:14:22 -0400...Re: Deleting SAS Data from a SAS DATASET #6
I have been watching this thread today and I just now recall an example
that Paul Dorfman gave at a RUG several years ago and no, I don't recall
exactly where or when other than it was NESUG or SESUG in the past 5 years.
Anyway, Paul had a client who was storing something like the past 12 months
of transactions as variables andat the start of each month needed to stick
the just ended month on the end and drop the oldest month. Paul used Peek
to read the last 11 months of each obs as a single chunk of data, append
the current's month, and then used Poke to write the whole new obs as a
...Re: Deleting SAS Data from a SAS DATASET #19
On Mon, 18 Aug 2008 10:26:14 -0400, SUBSCRIBE SAS-L Chandra Gadde
>When I used this code, I am receiving the following warning. It completely
>deleted my prod.master_date SAS Dataset. Do you know what is going on here?
>WARNING: This SAS global statement is not supported in PROC SQL. It has
In PROC SQL, WHERE must be a clause within a statement, not a freestanding
statement. Get rid of the semicolon immediately before the word "where".
Incidentally, I think the warning is inaccurate in referring to a WHERE
statement as a global statement.
>On Fri, 15 Aug 2008 13:17:25 -0500, Mary <mlhoward@AVALON.NET> wrote:
>>One thing you might do is to add an index on the snap_dt to the dataset;
>if that's there then you should be able to delete the records in place:
>> delete from prod.master_date;
>> where snap_dt = "&end_dt"d;
>>In both the ways you are trying now you are creating new data sets rather
>than deleting records from the current data set; it would seem to me that a
>SQL delete statement would be faster than creating new datasets even if
>there isn't an index on the date.
>> ----- Original Message -----
>> From: SUBSCRIBE SAS-L Chandra Gadde
>> To: SAS-L@LISTSERV.UGA.EDU
>> Sent: Friday, August ...Re: Deleting SAS Data from a SAS DATASET #5
I also read that this could be a problem on machines that have multiple =
processors, such as running DB2; if the data is clustered and each =
processor takes care of one cluster, then you could have queries all =
hitting the same processor instead of distributing the load across all =
processors, thus potentially slowing down queries in peak periods where =
you have multiple queries at the same time, if queries tend to be based =
on the month (such as bank statements). Thus I'd proceed with caution =
on the idea of splitting one table into 24 tables with one view without =
making sure th...Re: SAS Macro to delete a SAS dataset 196997
> From: SAS Techies
> Subject: SAS Macro to delete a SAS dataset
> Here's a simple SAS Macro to delete a SAS dataset...It takes the name
> the SAS dataset as the parameter...
> %macro deletedsn(dsname);
> %if %index(&dsname,'.') eq 0 %then %do; %let lib=work; %let
> dsn=&dsname; %end;
> %else %if %index(&dsname,'.') eq 0 %then %do; %let lib=%scan(&dsname,
> 1,'.'); %let dsn=%scan(&dsname,1,'.'); %end;
> proc datasets lib=&lib nolist;
> delete &dsn;
> qui...creating a permanent sas dataset with obseravtions removed from the original sas dataset
could you please suggest me.I've a sas dataset "mydata" with 50
observations and want to permanently create a new sas dataset "set"
which doesnt have 10 and 20 observations .I run the code below-
libname sc "C:\Sas\";
proc reg data=sc.mydata;
model Exam=Test Anxiety Preparation Notes;
where Score NOTIN(10,20)
proc print data = set;
The observations are still in the new "set" dataset but in the output
window these observations dont appear.
Kindly guide what do i need to chnge in the ab...Re: Creating SAS dataset with one Variale #4
Thank you so much. You all have provided very good solution. This really
...Re: How to combine multiple SAS dataset into 1 #4
More on green programming :
Michael is completely right to recall the advantage of using views.
Using view in general not only does reduce disk space but in some situation it can dramatically reduce computing time.
(yes it does!). Typically when you have to write several intermediate data steps before the final one, you are likely to take advantage to using views in the intermediate steps to avoid disk read/writes.
Here is a simplistic illustration :
Instead of ...
Data B; (1 write)
Set A; (1 read)
Proc sort data=B;by x; (1 read, 1 write)
Data C; (1 write)
Set B; (1 read)
Total : 3 reads, 3 write (approx.)
... Try this:
Data B/view=B; Set a;run;(0 read, 0 write so far)
Proc sql; Create view B2 as
Select * from B order by x; (still 0 read, 0 write)
Run; (Total : 1 read,1 write)
These are obviously bare approximation since I do not consider the temporary hidden files created by the steps, but in a previous real situation, we reduced treatment time from a few hours to 20mn.
De : SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] De la part de Michael Raithel
Envoy� : jeudi 19 mars 2009 15:13
� : SAS-L@LISTSERV.UGA.EDU
Objet : Re: How to combine multiple SAS dataset into 1
Shaheen posted the following:
> I have bunch of FCOV sasdataset which I want to combine to
> one big dataset. Please help... I am missing the last part
> where I have to append the file.
&...SAS 6 dataset on MVS to SAS 9.1 dataset on Windows 2003
Hi! All members,
I'm quite new to SAS.
I created a sas dataset using SAS 6 on MVS and FTP to Windows
environment. The physicall file name is LossNot (no file extention).
When I tried to bring in this dataset using SAS 9.1 on Windows 2003
Server, I got the error:
NOTE: Input library MYXPORT2 is sequential.
ERROR: File MYXPORT2.ALL. is not a SAS data set.
Below are the codes on MVS SAS 6, Windows SAS 9.1 and the error
==== Codes on MVS SAS 6 =============================================
//MyIDA JOB (318,ILS,999,999,,RJE),abc,CLASS=C, ...Re: Is it possible to read a sas dataset NOT using sas? #2
I think SPSS and DBMSCopy can read SAS datasets. Also for sure WPS.
On Tue, 18 Mar 2008 06:43:44 -0700, RolandRB <rolandberry@HOTMAIL.COM>
>Is it possible to read a sas dataset NOT using sas and have
>observations and variables etc. rather than having meaningless chunks
...Re: SAS Macro to delete a SAS dataset #2 313487
I too like(d) PROC DELETE.
When I used it I was forced to remove it and use PROC DATASETS because
PROC DELETE is not documented.
Also, but I have not tested it. How does it work with indexed data
sets, audit trails, generation data groups, views, etc.?
I don't worry much about deleting, "all" of my programs run in batch
and are obsolete as soon as they are written.
On 12/3/09, Fehd, Ronald J. (CDC/CCHIS/NCPHI) <email@example.com> wrote:
> > From: SAS Techies
> > Subject: SAS Macro to delete a SAS dataset
> > Here's a simple SAS...