Re: Read SAS date from log/turning it into SAS datetime value
Treat blanks, colons, and commas all as delimiters. If that's inappropriate
elsewhere, make the delimiter a variable so that it can be changed on the
fly. Something like(untested):
infile whatever dlm=CurrentDelimiters;
CurrentDelimiters = ' :,';
input hour minute day month:$3. date year:$4.;
On Sat, 14 Feb 2004 00:47:35 GMT, RICH0850 <rich0850@AOL.COM> wrote:
>I need to read a SAS log with the initialization value of:
>08:32 Thursday, January 16, 2003
>It's there, we all see it and love it (it's when the job started, at the
>the log file).
>I'd like to turn this into a SAS datetime value.
>Now I can parse this thing, but I was betting that the group had
>Has anyone encountered this? And, if so, any easy solutions? Hard
...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
>time, Dataset name.
>***************Sample log file********************************
> data Purchmeta_US (keep=Name Start Length Description);
>SYMBOLGEN: Macro variable METAPATH resolves
>41 infile "&metapath" ;
>42 input @ 'Field name="' name1 :$17. @;
>43 a=index(name1,'" ');
>45 input @'col="' Start :$3. @ 'len="' length :$1.@;
>46 input @'<Description>' Desc &$100.;
>NOTE: The infile "/export/home/anjapara/838594.meta" is:
> File Name=/export/home/anjapara/838594.meta,
> Owner Name=anjapara,Group Name=rg...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: 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: SAS Advanced Programming Exam for SAS 9: SAS Joke of the year. #2
Test preparation is akin to following a simple algorithm:
1. Evaluate the test and discover if it is worth taking.
2. If #1 evaluates false then go to exit.
3. Determine if your *test* knowledge of SAS is insufficient.
4. If #3 evaluates true, do the test preparation.
5. Pay the money.
6. Take the test.
From your standpoint, the step of paramount importance is step #1. That is
where you mainly failed. From SAS' standpoint, only one step matters: #5.
This is the only reason the test was created in the first place.
The world would be a better place if all employers understood that as well.
However, some recruiters/HRers require the certificate as a CYA backup
should they accidentally hire a pure test-passer.
Fortunately, I have not seen many occurrences of this nature since the
inception of the boondoggle, perhaps because most candidates are almost
inevitably interviewed by people qualified in SAS better than HR. And most
qualified people saw the program for what it is even before its advent.
SAS-L is replete with numerous posts to prove it.
Needless to say, it does not imply in any way that any certificate-holder
has no more SAS behind the belt than the certificate can cover. Far from
that! Many fantastic real-world people have been forced into the thing by
their SAS partnership business needs, many have taken it just for the heck
of it because their employer would pay for it, etc.
My opposition to the thing as a matter of principle is based on t...Re: Unix SAS: How to save log file while in SAS session? #2
On Wed, 18 Aug 2004 12:18:03 -0500, Duck-Hye Yang <dyang@CHAPINHALL.ORG>
>I am using SAS Unix Display manager.
>I put together single small sas programming files in one giant sas
>I need to save log and output files AFTER each single small programming
>The problem is that I do not know how to save log and output while in SAS
>Below is the outline of what I'd like to do:
>DM 'clear log';
>DM 'clear output';
>SAS 1 programming start here
>x 'file "SAS...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: 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: PC SAS 9.1
If you run SAS in batch mode the dir the .sas file is in will by default be
the dir where the .log and .lst files will be left.
Regards - Jim.
Jim Groeneveld, Netherlands
Statistician, SAS consultant
My computer remains home while I will attend PhUSE 2006 in Dublin.
On Tue, 12 Sep 2006 09:23:15 -0400, Jon Hayward <jhayward1@BABSON.EDU>
>Is there a setting in PC SAS so that whichever directory I save my .sas
>file to, SAS will automatically go there when I want to save my .log
>and .lst files?
>Currently I must specify each location. While I am sure that there is a
>reason for this, I am hoping that there might be a setting to allow me to
>specify that I want SAS to remember my current active location for the
>duration of that session... So the next time I open SAS, I will perhaps
>save a different .sas file to a different location and then SAS will know
>to go there to save the corresponding .log and .lst files.
>Thanks in advance for any insights.
...Re: SAS maps / SAS Graphs #2
I had to look that up, and found this:
a.. If a picture is not worth a 1000 words, to hell with it (quote from =
Ad Reinhardt -- note this is from the original Chinese quote that "a =
picture is worth 10,000 words).=20
-Mary (who actually right this instant is working on a trying to make a =
"nice" diagram right now from a sketch done on the back of a file folder =
with over 50 circles and connecting lines everywhere)
----- Original Message -----=20
From: data _null_,=20
Sent: Thursday, March 06, 2008 12:15 PM
Subject: Re: SAS maps / SAS Graphs
How do you define nice?
Do you use Tufte's Data-ink ratio?
On Thu, Mar 6, 2008 at 12:08 PM, Vincent Granville
> We are looking for nice SAS graphs to post in the image section on
> AnalyticBridge. If you have produced such graphs, you are welcome to =
> them (migh require a sign up, but it's free). You can also rate the =
> posted by other participants. It's a good way to be noticed for the
> quality of your work. See http://www.analyticbridge.com/photo/photo =
> view the graphs currently posted (not all of them are produced with =
...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: SAS 8.2 to SAS 9.1 libname convertion #2
I am able to read Access 2000 tables using SAS 9.1.3, with syntax modeled
proc contents data=bb._all_; run;
to see what tables and views are detected.
On Fri, 8 Jul 2005 13:51:40 -0700, DC <chendlcan@YAHOO.COM> wrote:
>my codes created on SAS 8.2 does not work on SAS 9.1?
>Anyone knows how to convert the below code to SAS 9.1?
>Thanks a lot!
>libname bb dbaccess 'x:\a\b\c\d.mdb' bbb='asdfgh
>libname cc dbaccess 'x:\a\b\c\d.mdb' ccc='asd zxc';
> create table eee as
> select b.*
> from cc.ccc A, bb.bbb B
> where a.id=b.id;
>libname bb 'x:\a\b\c\d.mdb' ;
>libname cc 'x:\a\b\c\d.mdb' ;
> create table eee as
> select b.*
> from cc.asd_zxc A, bb.asdfgh_zxcvbn B
> where a.id=b.id;
>seems sth wrong with "asdfgh_zxcvbn"
>log shows "File bb.asdfgh_zxcvbn.DATA does not exist."
>Sell on Yahoo! Auctions � no fees. Bid on great items.
...Re: suggest: improve SAS Deployment Wizard for SAS v9.2, phase 2
Subject: Re: v9.2 phase 2, page update
"Make the installation of SAS BI Server easier!"
Just remember that the majority of us are still just installing only
SAS Foundation v9.2, and possibly Enterprise Guide v4.2
My rant/suggestion to Tech Support has been addressed.
I have added notes about my conversation with Tech Support
to this sas community wiki page:
summary: if you have Build # greater than or equal to 28
then you can dispense with ForceInstall.
Ronald J. Fehd, IT Spec
HelpDesk Level 3: SAS
CDC S...Re: SAS Negative Date Values #2
You should use the INTCK function to calculate the difference between to dates.
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of pritesh
Sent: Saturday, December 06, 2008 5:01 PM
Subject: Re: SAS Negative Date Values
On Dec 5, 6:54 pm, Virtual SUG <sfbay0...@aol.com> wrote:
> On Dec 5, 6:10 pm, pritesh <priteshka...@gmail.com> wrote:
> > I have a slight problem. I am trying to create an age variable for my
> > dataset. The problem I am having is that some patients were born in
> > 1920s or 1930s and therefore when I create an age variable, it is
> > negative in some cases. Is there a way for me to convert these
> > negative values to positive values so that I don't have a negative age
> > value (when I divide by 365) for patients? Thanks :)
> I think there's a misunderstanding here about how SAS stores the
> values of date variables in your data sets.
> A SAS date variable is the number of days before or after Jan 1,
> 1960. If, in your case, the patient was born on 1/1/1960, then their
> SAS date value is zero (0). If they were born after 1/1/1960, their
> birthday is stored as a positive integer, and if they were born BEFORE
> 1/1/1960, then their date value is a negative integer.
> I am not sure why you want to divide a SAS date variable's value
> representing someone's birthday...Re: SAS Date Values conversion #2
You can use an input function to create a SAS date value from the character
form. Do note that the new value is stored as the number of days since Jan
1, 1960 and that the format (date9.) simply tells SAS to display it using
the ddMMMyyyy format.
input acc_date $6.;
New_acc_date = input(acc_date,mmddyy6.);
format New_acc_date date9.;
Environmental Specialist III
Dominion, Environmental Biology
4111 Castlewood Rd
Richmond, VA 23234
Phone:804-271-5313, Fax: 804-271-2977
Sent by: "SAS(r) cc
GA.EDU> SAS Date Values conversion
Please respond to
I have a SAS dataset with a variable called acc_date with a Char 6
values as follows:
...Re: Problem to read in date to SAS #2
Not too intuitive but my brain doesnt seem to want to get out of first gear
Data _Null_ ;
Text = 'Monday, January 12, 2006' ;
Date = Input( Compress( Scan( Scan( Text , 2 , ',' ) , 2 , ' ' ) ||
Substr( Scan( Scan( Text , 2 , ',' ) , 1 , ' ' ) , 1
, 3 ) ||
Scan( Text , 3 , ',' ) ) , Date9. ) ;
Put Text= Date= Date= Date9. ;
When everything is coming at you all at once, your in the wrong lane.
A truly happy person is someone who can smile and enjoy the scenery on a
From: Sarah Cox <saslearner2006@GMAIL.COM>
Reply-To: Sarah Cox <saslearner2006@GMAIL.COM>
Subject: Problem to read in date to SAS
Date: Mon, 16 Oct 2006 14:41:48 -0400
I have a date field in the text file with following foramat:
Monday, Janauary 03, 2001.
And I want to read it into SAS and convert it into SAS date.
How can I do it?
Thank you very much for your advice!
...Re: Date value from SAS to Oracle #2
libname mydblib oracle user=karin password=haggis;
libname saslib 'your-SAS-library';
proc append base=mydblib.internat(sasdatefmt=(dates='date9.'))force
You need to use "SASDATEFMT= "
Or look at
This will solve your problem.
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Sent: Wednesday, June 28, 2006 3:52 PM
Subject: Date value from SAS to Oracle
I have a SAS Dataset with a numeric variable formatted with DDMMYY10.
I need to transport this dataset in Oracle.
I used the libname oracle engine to access Oracle Schema and then a PROC
SQL statement to insert records in destination table, but, in Oracle,
the date column is saved with 01/01/1960 value.
Thanks in advance
"This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient,any disclosure,copying, use, or distribution of the information included in this message and any attachments is
prohibited. If you have received this communication in error, please not...Re: SAS date problem with log #2
While dates aren't my fortay, and I'm sure a number of those on SAS-L can
improve on the following code, it looks like your date is actually a
number. It also looks like no day is present (at least in the examples
shown in your log).
As such, would the following code meet your current need?
input id date;
format newdate yymmdd8.;
On Mon, 17 Jan 2005 22:04:04 -0600, nkhan12 <nkhan12@UIC.EDU> wrote:
>Thanks all for replying. However, i cant seem to figure out the problem.
>Attahc is my log. Is it possible when the data was given to me the date
>somehow formated. But i do not see any format in the proc contents.
>2055 newdate=input( put(date, 8.), yymmdd8.);
>NOTE: Invalid argument to function INPUT at line 2055 column 9.
>id=00398740 date=20000100 newdate=. _ERROR_=1 _N_=1
...Re: Reading Web logs with SAS #2
For what it's worth, I use SAS to parse Microsoft IIS logs, and the way
I do it is to use a free executable from Microsoft called Logparser
4c25-91b2-f8d975cf8c07&displaylang=en). Logparser allows you to treat
one or more IIS logfiles as if they were a single unified database table
against which you can execute SQL statements. You can control the
output of the query in things such as column order and output format. I
use Logparser to select the fields I want in a particular order and make
sure that they come back in CSV format. Since Logparser is a command
line tool, I call logparser with my specific query, make it output CSV
to stdout and then use the 'filename PIPE' structure in SAS to stream my
results back to a SAS dataset where I have predefined infile,informat,
and input statements that match my query. It works quite well.
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Sent: Monday, March 30, 2009 11:37 PM
Subject: Re: Reading Web logs with SAS
On Mar 30, 4:35 pm, yamira...@YAHOO.COM (Richard Whitehead) wrote:
> someone on another forum posted that web logs can be read directly
> proc import. is this true? btw, i am in a brief sas-less period, so
> can't actually check for myself. :-) anyway, regardless, of the
> the above, is there an easy way, i...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: firstname.lastname@example.org
> 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: Running SAS jobs sequentially in batch mode
> Note that unless you clean up work datasets and any macro variables
created by each production job, subsequent jobs will not be starting in
a pristine environment. It may be a good idea to include a new program
between each production job to kill all work datasets and query
sashelp.vmacro to create %symdel statements to delete macro variables.
Would you be kind enough to give sample statements to do the CLEANING
1211 Avenue of the Americas
New York, NY 10036
From: SAS(r) Discussion [m...Re: SAS/DMS library default library allocations using SAS V8.2 on #2
The library allocations have to be stored <somewhere>, otherwise you
wouldn't continue to get the prompt. You can look under your userid to see
if it's there (though I suspect you've already done that), but a better
question would be directed at the SAS sysadmin--ask them where these
profiles/customizations are stored (the sasuser.profile is the generic
one--your personal one is concatenated along with it). You may be able to
see your session info under your userid tso log (shows usage information),
though off the top of my head I can't remember if it captures al...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 and variables etc. rather than having meaningless chunks
To be explicit start at
Russ Lavery and I have a NESUG Paper "An Annotated Guide: The New (8.2),
Free & Fast SPDE Data Engine". It will be availiable at
whenever everyone has general access to papers.
Date: Mon, 3 Jul 2006 12:40:24 -0400
Sender: "SAS(r) Discussion"
From: Ken Borowiak <evilpettingzoo97@AOL.COM>
Subject: Re: SAS - 9; Partition of SAS Datasets.
Comments: To: chandu.isi@GMAIL.COM
Content-Type: text/plain; charset="us-ascii"; format=flowed
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.