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: How to read such kind of raw data?
Try with delimiter = ','
On Mon, Oct 20, 2008 at 3:59 PM, Eason Chu <
> I have a raw data file (.csv), whose fileds are seperated by a comma
> and embedded with double quotation marks. Its patern looks like as
> I used the following code,
> Data a (compress=yes);
> infile "infile location" dsd missover lrecl=1000000
> informat ...;
> format ...;
> input ...;
> But some of the input fileds' value contain double quotation marks and
> even commas, appearing to be as below:
> However, there ill-mannered field values disrupted the data input.
> I don't know how to read and input such raw data in a SAS data set.
> Please give me some suggestion which will be much appreciated.
...Re: how to read quarterly data in SAS? #2
On Sat, 3 Nov 2007 22:26:04 -0000, Richard <hujian@GMAIL.COM> wrote:
>I got the error message when I was using informat yyq. The original
>data set is in .txt and delimited by space.
>input time $ yyq6. growth sensitive insensitive differnce recession;
>ERROR 48-59: The informat $YYQ was not found or could not be loaded.
It's numeric. Remove the dollar sign ($).
Thanks a lot! It works.
On Nov 3, 6:27 pm, nos...@HOWLES.COM ("Howard Schreier <hs A...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 ...Re: question on reading raw data #2
You'd need to use a UDF. There are probably 1e8 of these available on a
quick google search; one example is
Function colorofcell(ref as range)
put in the VB editor; then you just use
and it will have the RGB color; for example, "pure" red is 255. Be aware
that any function based on color will NOT change until the value itself
changes in the cell (or the sheet is closed/reopened); just changing the
color with your mouse will not cause the function to be...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: Reading datetime raw data (YYYYMMDDhhmmss) #2
Try the ND8601DT informat.
input date ND8601DT. ;
format date datetime20. ;
Environmental Specialist III
Dominion, Environmental Biology
4111 Castlewood Rd
Richmond, VA 23234
Phone:804-271-5313, Fax: 804-271-2977
Sent by: "SAS(r) SAS-L@LISTSERV.UGA.EDU
<SAS-L@LIST...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: 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: 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: 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: 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: 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: 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: 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: couldn't find a format to read the date from my raw data? #2
In case you have different values than 0000000 then do something like this
/*I just made a sas dataset of time variables */
input date$10. time $10.;
data aa1 ;
temp = Catx("T",date,time);
date_all = Input ( temp ,ymddttm.) ;/*Thanks to data _null_ this is format
you are looking for */
Format date_all datetime20. ;
Hope this is going to help you .
On Tue, Sep 23, 2008 at 4:14 PM, Xuhong <email@example.com> wrote:
> I couldn't find a correct informat to read the date related variables
> into SAS. I extracted partial of my raw data as below. The raw file
> is .txt file with comma delimited.
> 2007-09-01 00:00:00,1,2007-09-01 00:00:00
> 2007-09-11 00:00:00,6,2007-09-04 00:00:00
> 2007-09-30 00:00:00,1,2007-09-04 00:00:00
> 2007-08-01 00:00:00,4,2007-06-04 00:00:00
> 2007-09-14 00:00:00,1,2007-09-04 00:00:00
> 2007-09-01 00:00:00,5,2007-05-04 00:00:00
> 2007-09-01 00:00:00,1,2007-09-04 00:00:00
> 2007-09-01 00:00:00,1,2007-09-04 00:00:00
> Hope some one here could give me a hand.
> Thanks very much!
...Re: Need help reading raw data file with semi colon delimiter
On Wed, 28 Mar 2007 19:40:17 -0400, Huong Halpin <huongnhalpin@YAHOO.COM> wrote:
>I have a data file with semi colon delimeter. I used the infile statement
> infile ‘file' DLM = ';' DSD MISSOVER lrecl=206;
> input var1 $3
> var2 3
> var3 $8;
>The output shows:
>xxx ;56 7;yyyyyy
>It looks like the DLM = ';' was not executed. Can anyone tell me what's
I cannot explain the output because you do not show the input data or the
code used to generate the output.
I notice...Re: SAS reads Oracle
Well, if the destination column is say, a NUMBER, and you're trying to
insert values that are mostly numbers along w/some values of "_all_",
then sure--changing your column to a VARCHAR2 will make the problem go
away. But you don't need me to tell you that.
I guess I need more info. Can you show us a DESCRIBE TABLE on the
oracle table in question, and the sas code you're using to fill it, and
the particular error messages you're getting in the log?
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Sent: Fr...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: Problems with 9.2
So you get some success if you reduce the amount you're copying/pasting?
I would guess that there is some format or some such in the data that
you're copying/pasting that is causing the problem.
As I haven't run into any issues with 9.2 reading large datasets, nor
have I seen too many complaints on SAS-L, I would be surprised if one
did exist. That's why I would focus on the copy/paste method you are
Scientific Information Specialist
Centers for Disease Control and Prevention
NCHHSTP\DHAP-SE\QSDMB\Data Management Team
Email: yzg9 at cdc dot gov
>>On Behalf Of Holger Bargen
>>Sent: Tuesday, February 10, 2009 11:33 AM
>>To: SAS-L@LISTSERV.UGA.EDU; Gerstle, John (CDC/CCID/NCHHSTP)
>>Cc: Holger Bargen
>>Subject: Re: Problems with 9.2 - reading of data
>>Thank you for your response.
>>Trying to copy the data into notepad and then transfer it to SAS did
>>lead to any success. The astonishing thing is that the data, which
>>the problem, are read fine, if I reduce the volume of the entire
>>(e.g. reduce it to only one sampling data). This means that there is
>>problem with the formating of the data but the capability of SAS 9.2
>>re...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: 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: 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: 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...