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: Deleting SAS Data from a SAS DATASET #2
Chandra - this isn't my expertise area - I'm sure others may have better
ideas but I'll make three comments.
If your datasets have a large number of variables, in your datastep
method a WHERE clause will be more efficient - the IF statement causes
each record to be fully read before it can be selected for deletion. A
WHERE clause would only read the single variable in the case of records
that meet the criteria for deletion.
where snap_dt ne "&end_dt"d;
You probably would be better off changing your data model though - my
first thought would to be to store your data as separate yearly or
monthly files and then access them with a view of the past two years or
24 months. With each month or year you would delete the oldest file and
change the view one time period forward.
*set up the data;
data time1 time2 time3 time4;
do i = 1 to 100;
do t = 1 to 4;
if t=1 then output time1;
if t=2 then output time2;
if t=3 then output time3;
if t=4 then output time4;
*three successive example views;
data filet1 / view=filet1;
set time1 time2;
data filet2 / view=filet2;
set time2 time3;
data filet3 / view=filet3;
set time3 time4;
One more thought - since the data are appended - if the file is not
reordered and you have the record counts from each append - then you can
use firsto...Re: how to read quarterly data in SAS?
You are looking for the YYQ informat.
27?? data _null_ ;
28??? qob='1947Q1' ;
29??? qob_d=input( qob, yyq6. ) ;
30??? put qob= qob_d=date9. ;
31??? run ;
From: Richard <hujian@GMAIL.COM>
Sent: Sat, 3 Nov 2007 5:52 pm
Subject: how to read quarterly data in SAS?
how to read time variable like 1947q1 from excel file? any informat?
Email and AIM finally together. You've gotta check out free AOL Mail! - http://mail.aol.com
...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: 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: read Access data in SAS #2
On Thu, 11 Oct 2007 08:46:26 -0500, Bruce J <chimanbj@GMAIL.COM> wrote:
>If you have Access to PC File Formats, you can use the syntax:
for SAS V. 9+
clarification: "Access" above refers to SAS/Access;"access" below refers to
>Libname mdb access "PATH\file.mdb";
>From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Little
>Sent: Thursday, October 11, 2007 8:14 AM
>Subject: read Access data in SAS
>Guys, I was given a Access data file to do some analysis. Can anyone share
>your idea or code of how to read Access data in SAS. Do I have to go into
>Access and export or do Import in SAS?
...Re: SAS Reading Cognos Data #2
I have worked at two sites that used both SAS and Cognos, at both we dumped
data from Cognos PowerPlay (an OLAP / multidimensional tool) into CSV
(comma separated value) text files, if we wanted to analyse it in SAS. If
we wanted to go the other way we did the same thing - dump it into a
delimited text file.
I doubt that you could use ODBC since it is tightly bound to SQL and
relational-like structures. (I'm fairly sure there isn't an ODBC driver
for Cognos PowerPlay.)
SAS does provide the "SAS Access Interface to OLE DB" and both SAS and
Cognos PowerPlay can be OLE DB co...Re: Read SAS date from log/turning it into SAS datetime value #2
Hi Richard, Rich
The datestyle Rich0850 finds, occurs in the log produced by a batch-sas
session - and doesn't appear on an interactive-sas session log.
Where you can anticipate the use for later parsing of the log, I would
reccommend - as Richard (Richard A. DeVenezia <radevenz@IX.NETCOM.COM>)
did - insert into the autoexec, a statement to generate a more-easily read
datetime. In all my sessions, (keeping altlogs of all interactive sessions
has proved very very useful, time and again) I have this statement at the
end of the autoexec.......
%put starting (contract/project/applicatio...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: 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: help with reading ASCII data into SAS #2
> -----Original Message-----
> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On
> Behalf Of olivesecret@GMAIL.COM
> Sent: Wednesday, November 05, 2008 8:50 AM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Re: help with reading ASCII data into SAS
> Yes, I did it with delimiter=',' dsd firstobs=2, but was told invalid
> data for each variable.
> Any more suggestions? Thanks a lot!
You will need to show us the actual code you are using to read the file if you want more than just a guess as to what went wrong. Seeing the log file with actual error message would be helpful as well.
Daniel J. Nordlund
Washington State Department of Social and Health Services
Planning, Performance, and Accountability
Research and Data Analysis Division
Olympia, WA 98504-5204
Here is my code:
infile 'data.txt' delimiter=',' dsd firstobs=2;
input site id pid it $ dd itd rtd linkid sp fc dtc dtm u $5. ;
Here is one more obs:
Other obs are similar.
Thank you very much!
On Nov 5, 12:24 pm, Nord...@DSHS.WA.GOV ("Nordlund, Dan (DSHS/RDA)")
> > -----Original Message-----
> > From: SAS(r) Discussion [mailto:SA...@LISTSERV.UGA.EDU] On
> > Behalf Of olivesec...@GMAIL.COM
> > Sent: Wednesday, November 05, 2008 8:50 AM
> > To: SA...@...Re: Reading unstructured data using SAS #2
Ashok posted, in part, the following:
<<Ashok's entire original posting can be found beneath the Sig line>>
> I want to read an html file using sas. The content of the file is
> below. The sample file is the single record copied from html.
> Can we use SAS to read unstructured data ?
I can't answer your exact question, but can point you to a resource that you can use to explore this issue further. Check out the SAS 9.2 Language Reference Dictionary
http://support.sas.com/documentation/cdl/en/lrdict/61724...Re: suggest: improve SAS Deployment Wizard for SAS v9.2, phase 2 #2
> From: A Little Birdie
> I just searched the SAS-L archives (should have done that
> first) and found references to these two pages:
> Have you seen this page?
> http://support.sas.com/kb/35/631.html <---<<< NICE!
> It looks like it addresses your needs, and might be something
> nice to add to the SASCo...Re: MVS Merge Variable Data Using SAS Merge or SAS SQL JOIN #2
You may want to consider using nested queries to create the keys that you
need to join the tables? That gives the SQL compiler a way to bound the
search space. For example,
create table temp as
from (select <key transformation>,* from small) as t1
left join (select <key transformation>,* from large) as t2
on t1.<transformed key> EQT t2.<transformed key>
Now the SQL compiler has two keys from the same domain that it can index or
use as sort keys. This method works with composite keys as well. Just make
sure that the <transformed key> v...Re: How to Read PDF/RTF data in to SAS datasets #2
On Tue, 28 Nov 2006 14:50:49 GMT, John I <not@HOTMAIL.COM> wrote:
>Frank Poppe wrote:
>> John I schreef:
>>> Richard A. DeVenezia wrote:
>>> > "Susiyanto, Dwi (GE Money)" wrote:
>>> >> Hi SAS experts,
>>> >> I have data of account list (that is like text file) in PDF/RTF
>>> >> format. If i looked in RTF/PDF , it will show the column and account
>>> >> list (including header of report), but when i do to copy paste to
>>> >> text file (by using edi...Re: read excel data cell and formula from SAS #2
On Thu, 27 Apr 2006 11:46:23 -0400, Joan Zhao <hongzl@OPTONLINE.NET> wrote:
>Does anybody know that how can I read a specific data cell in a EXCEL file
>from SAS through DDE? What's command or function can I use?
Any reason you can't do it the usual way, by having the triplet point to
just the one cell?
>how can I read a formula in EXCEL through DDE from SAS?
I haven't tried this, but what happens if Excel is told to display the
formula rather than the value in the cell being read?
>I...Re: Trying to read very dirty txt data into sas #2
If you read the data as a stream you can load what you want into a single
variable and then parse that variable directly.
INFILE 'email.txt' recfm=n LRECL=32767;
INPUT email $char32767.;
DDS Data Extraction
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of David
Sent: Tuesday, August 1...Re: R vs. SAS (was Replacement for SAS (SPSS vs. SAS, redux)) #2
Sounds like R is the SAS equivalent of Linux .. who are incidentally in all
sorts of a copy left/right mess at the moment.
On Thu, 5 Feb 2004 09:39:37 -0500, Peter Flom <flom@NDRI.ORG> wrote:
>I use both SAS and R; I"ve used SAS for 10 or 15 years, R for about 6
>months - 1 year.
>Each has strengths and weaknesses; I'd not like to give up either.
>Strengths of SAS (esp. compared to R)
>Tech support - I have SAS tech support's phone number and our license
>number memorized. They're great.
>SAS-L - There's also an R-help list...Re: Can SAS read XML data with special missing values? #2
If you use an XMLMAP you can apply an informat to the data read from the
XML file. Here's a little example:
<?xml version="1.0" encoding="windows-1252" ?>
<COL var="x"> 1 </COL>
<COL var="y"> 2 </COL>
<COL var="y"> 4 </COL>
<...Re: How to read data from stata file(.dta) in SAS 9.0 #2
by the way: if you still get errors, install a actual SAS version. The
below is for 9.1.3
On Mon, 28 Sep 2009 10:04:31 -0400, Gerhard Hellriegel
>try the following (adapt your dataset names):
>proc import out= hsb2 datafile = "c:\data\hsb2.dta";
>proc contents data=hsb2;
>On Mon, 28 Sep 2009 00:25:37 -0700, kondal <kondal717@GMAIL.COM> wrote:
>>I used following code to read data from stata file ( SAS 9.0) bu...Re: Ranges in sas? (was RE: Re: data step vs Proc sql) #2
Ooooh--interesting--thanks! I'll play with that...
From: SAS(r) Discussion on behalf of Rickards, Clinton (GE Consumer Finance)
Sent: Thu 4/20/2006 2:41 PM
Subject: Re: Ranges in sas? (was RE: Re: data step vs Proc sql)
Exactly. the only trick is that the range values must be integers.
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]On Behalf Of
Sent: Thursday, April 20, 2006 3:57 PM
Subject: Ranges in sas? (was RE: Re: data step vs Proc sql)
...Re: SAS Sample 1728 Was ---> Re: SAS Sample 1727 #2
I am not sure that the SI Tech Support examples should have all the error
checking that Chang wanted to throw in the macro. The examples should be
clear concise and easy to read and get going, as well as be illistrative.
Too much error checking in an example well is just over kill and even
detrimental to an example. However, any code solution on the SI Tech
Support web sit should follow basic rules of good practices and sound
advice. Such as with thier macros having atleast a somewhat good Macro
Look at Example SAS Sample 1728:
The first method well lets say is soooo bad...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 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...