Re: Unable to read Unicode file into SAS file
Another possibility is that proc import isn't correctly getting the right
formats and informats. If you already know what those formats and
informats should be, you can always copy, paste and edit (from the log)
the data step that resulted from the proc import run, adjusting any
incorrect formats and informats and then just run it as a data step.
Also, while I don't think it would make any difference, your proc import
contains two "datafile=chr" statements.
On Tue, 19 Jan 2010 21:06:11 +0530, Cherish K <c4cherish@GMAIL.COM> wrote:
>From MS SQL, I ext...Re: Autoexec.sas file Dm"pgm;zoom;"; doesnot wrk in SAS 9.2 #2
The PGM is the editor window up through v6.12
but also still exists today.
For the Enhanced Editor you can use:
dm editor 'zoom' wedit ;
Hope this is helpful.
Investment Business Intelligence
Investment Management & Research
Global Leaders in Multi-Manager Investing
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Ace
Sent: Wednesday, October 14, 2009 5:49 AM
Subject: Re: Autoexec.sas file Dm"pgm;zoom;"; doesnot wrk in SAS...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: Opening non SAS files with BASE SAS ? #2
If, when you check your licensing(i.e. SETINIT)
in SAS, if you have SAS/ACC-ODBC, then you can
easily setup an ODBC entry in your Windows ODBC
Wizard to your SQL Server. After doing that you
can run the SQL Server query from SAS directly
to SQL Server and have the result come right
directly back into SAS into a SAS dataset. See
the couple archive links below for syntax details.
The X command in SAS can run external commands
but the SQL-passthrough is what most of us use.
Hope this is helpful.
Senior Programmer Analyst, IM&R
Global Leaders in Multi-Manager Investing
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Sent: Wednesday, October 10, 2007 12:43 PM
Subject: Opening non SAS files with BASE SAS ?
Is there a function that executes a non SAS file?
I've written a macro that outputs a file with the extention SQL (EXE
would also be helpful).
*.SQL files are associated with SQL server on my computer so I'd like
to make SAS execute this file so it triggers the SQL server program.
Is this possible?
...Re: Reading SAS files from other programs #2
Have a look at the database converters DBMS/copy (Dataflux) and
Regards - Jim.
Jim Groeneveld, Netherlands
Statistician, SAS consultant
On Thu, 27 Apr 2006 12:56:57 -0400, Coleman, Mark
>I am a regular user of Mathematica from Wolfram Research, and a new user
>of SAS. I'm exploring the feasibility of reading native SAS files
>directly from Mathematica. Are native SAS files based upon SQL, or is
>some other proprietary file structure used? If so, does SAS offer some
>sort of ODBC driver?
...Re: Reading RTF files with SAS #2
I've never looked at the macro, but take a look at:
On Wed, 18 Mar 2009 18:32:33 -0400, Jake <johbee@GMAIL.COM> wrote:
>Does anyone know if SAS can read RTF files? The reason I need
>to do this is to get a list of Titles from all the output in a bundled rtf
>vs. doing it manually.
>Thanks, for any information (publications, etc)
...Re: how to read gzip file in SAS #2
How to debug gunzip?
Install *GNU Tar* and *GNU GZip* for Windows. Added "C:\Program
Files\GnuWin32\bin" to my Path System variable by going to Control Panel-->
System Properties --> Advanced Tab--> Environment Variables
Did I added wrong path?
On 11/1/07, Howard Schreier <hs AT dc-sug DOT org> <firstname.lastname@example.org>
> On Thu, 1 Nov 2007 12:21:58 -0400, wraong <wrong.wang@GMAIL.COM> wrote:
> >I need to read gzipped files. I tried with filname command as bellow:
> >filename medpar pipe 'gunzip -c E:\seer_med\200501\medpar91.txt.gz';
> >/*reading in a zipped file*/
> >In the log file, it said "'gunzip' is not recognized as an internal or
> >external command,
> >operable program or batch file."
> >How can I solve the problem?
> >Thanks for kind help.
> I don't think it's a SAS problem. Debug your GUNZIP invocation from a host
> OS command line.
...Re: read excel files into SAS #2
A quick way to solve it is to use DDE, which you can specify the first
row to be read as data and specify the informat as well.
On 8/8/05, Joan Zhao <email@example.com> wrote:
> I found a problem when I read a excel file into SAS. The initial seceral
> rows(more than 8 rows) of one of the column in this file are blank and then
> follwed by numeric numbers. In this column, most cells are empty. When SAS
> read in this file by no matter what approach(SAS/ACCESS--import procedure
> or OLEDB), nothing in this column is read in. The generated SAS dataset is
> empty. If I change the whole column's datatype to character(text) in excel,
> then problem is solved. Or if I fill in a numeric number within first 8
> rows, then the whole column can be read in as well. But if I fill in the
> number after 8th row, then nothing is read in.
> Does anybody know what's going on? Why cannot the data be read in if the
> data is numeric and with first 8 rows blank? Thank you in advance!
> Joan Zhao
WenSui Liu, MS MA
Senior Decision Support Analyst
Division of Health Policy and Clinical Effectiveness
Cincinnati Children Hospital Medical Center
...Re: Reading PDF Files into SAS #2
You have received several responses that speak of using some external tool
to do a pdf to text conversion and then, presumably, you would parse the
text with SAS. These responses depend on the PDF having been produced by a
pdf writer and not by the file being a scanned image. In the later case,
you would need to use an OCR reader to convert the pictures to text.
Do you need to do only a few conversions or many and will this be an
ongoing task? If you are only going to do an occasional conversion, I
would use the Save As Text which is found in Adobe Acrobat Reader 7.0 and
maybe earlier. However, if this is a larger project, I would (and have)
used an external program to do the conversions. I have a paper from several
years ago posted at
This describes how I used a tool that converted one pdf at a time and
controlled this from within the SAS program. Since that time, I have had a
similar project and was not able to get the pdf converter that I used
earlier to work. However, I found one available on line that converted all
of the pdfs in a folder in one pass I was able to eliminate all of the SAS
calls that ran the external process. I ran that particular job from home
since there are restrictions on using unapproved tools here at work and I
do not recall the name of the converter.
Environmental Specialist III
Dominion, Environmental Biology
4111 Ca...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: running a sas file within a sas file
Like Joep wrote: that seems to be the right thing for the macro facility.
With %include you are very static. With the macro facility that could be
very dynamic. The simplest thing is: you could provide the statements you
want to insert as parameter:
stmt2=%str(if y<2 then y=2;)
with many other things you can do, e.g. conditional creating of
statements, naming variables by parameters, create multiple statements
with macro loops and much more.
On the other hand: if you want to do such simple things like you wrote,
avoid any %INC or %MACRO things!
It is far more readable, if you don't use %INCLUDES. What do you think,
that data-step will do:
if age>11 then age=11;
keep name age;
On Mon, 9 Jun 2008 01:42:03 -0700, Joep Steeman
>On 9 jun, 09:20, zpe...@NATURE.BERKELEY.EDU (Zach Peery) wrote:
>> Sorry to bug you all with such an easy one, but I havent had much luck
>> with the usual help sources.
>> I just want to run a sas program file within a sas program file. For
>> example, in sas file 1 I want to set x equal to 2, then with file 2
>> invoked by file 1, I want to set y = 3.
>> So sas file 1 looks like this...
&g...Re: SAS 9.2 Update on problem re Help files #2
SNOTES is an approximately daily email from SAS STech Support listing
the new or changed usage notes since the last email. So the item
pertaining to you was:
32792 - SAS prompts you to rebuild the index when you press F1 to
request help while running a SAS procedure in SAS 9.2
Release(s) Reported: 9.2
Date Created: 28JUL2008
Date Last Updated: 11AUG2008
To subscribe, go to
You'll get an extra email on most workdays, but if you subscribe to
SAS-L you'll hardly notice one more.
It has news about tech support office hours and a few other things.
If you want even more news, and you have an RSS reader, you can go to
On Mon, 25 Aug 2008 11:10:05 -0400 (GMT-04:00), "Peter Flom"
> Hi Jack
> I don't think I've ever looked at tech support notes ..... where is it?
> Is it useful for browsing?
> -----Original Message-----
> >From: Jack Hamilton <firstname.lastname@example.org>
> >Sent: Aug 25, 2008 11:08 AM
> >To: Peter Flom <email@example.com>, "firstname.lastname@example.org" <SAS-L@LISTSERV.UGA.EDU>
> >Subject: Re: [SAS-L] SAS 9.2 Updat...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 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: read files on mainframe from pc sas #2
you don't say what version of SAS is in use on either the
mainframe or the pc.
if you license SAS/Connect, you can connect to the mf and
xfer the data. If you do now, you can save the data in
transport format (xport/cport), download to the pc and read
it. On the mf, ignore any conventions your systems folks
have told you about optimal blocking and use lrecl=80,
blksize=8000 and recfm=fb.
---- Original message ----
>Date: Sat, 8 Jan 2005 16:38:46 -0600
>From: kukda <mkukda@COX.NET>
>Subject: read files on mainframe from pc sas
>Is t...Re: reading multiple excel files into SAS #2
* READ ALL EXCEL FILES WITH SAME STRUCTURE *
* FROM A FOLDER INTO SAS USING MACRO *
* DATE: SEP-29, 2005 *
%macro ReadXls(dir =3D , out =3D );
* MACRO PARAMETERS: *
* DIR: FOLDER WHERE DATA IS STORED *
* OUT: NAME OF OUTPUT DATA TABLE *
/* DELETE TABLE WITH SAME NAME AS OUTPUT DATA */
/* MANIPULATION THE STRING OF FOLDER PATH */
dir1 =3D...Re: Creating SAS datasets from reading a file #2
Couldn't you accomplish what you want by using Proc SQL to crete two macro
variables and then use those variables in a data step? E.g.,
proc sql noprint;
select distinct "dwproject_"||state,
"if state eq '"||state||"' then output"||
into :data_st separated by ' ',
:if_st separated by ' '
On Fri, 11 Jul 2008 15:08:19 -0400, SUBSCRIBE SAS-L Chandra Gadde
>Thanks for the quick response. I could hard code those states.
>Unfortunately, we definitely need to take the input from a file which is
>subjected to change. That way, our users would like to have control on the
>file. We don't want to change the SAS code whenever there is a change in
>the input file that contains group of states. We definitely need to use
>On Fri, 11 Jul 2008 15:05:43 -0400, Nat Wooding
>>Interesting -- this is around the third time today that this question has
>>come up. You could use the approach
>> dwproject_md etc ;
>>if state ='NY' then output dwproject_NY; else
>>if state ='M...Re: Reading a file and Creating SAS datasets #2
Thank you Jane. It really helped me a lot.
On Mon, 12 May 2008 15:46:42 -0400, SUBSCRIBE SAS-L Jane Xue
>Wish this could hlep some:
> st="FL"; output;
> st="TX"; output;
> st="NY"; output;
> st="VA"; output;
> SELECT st INTO :stlist SEPARATED BY " "
> FROM stlist;
> SELECT count(*) into :totalst
> FROM stlist;
>%PUT &stlist. &totalst.;
> %DO n=1 %TO &totalst.;
> %LET st=%SCAN( &stlist., &i );
> DATA data_for_&st.;
> infile '..........';
> if .....=&st. then output;
...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: How to read a period in a variable from a file to SAS dataset #2
On Mon, 28 Jul 2008 02:01:10 -0700, =?ISO-8859-1?Q?Rune_Runnest=F8?=
>This is the file with the fileref MYFILE:
>DOKTITTEL: this is the first record
>DOKTITTEL: this is the third record
>I want the second record to be '.', not ' '.
>How can I obtain that?
>filename myfile "d:\temp\myfile.txt";
> length Dokumentbeskrivelse $40. ;
> infile myfile dlm=">>>" pad ;
> input @"DOKTITTEL:" dokumentbeskrivelse ;
Use the $CHAR informat.
...Re: Reading a Unicode File into SAS 9.1 #2
Sure. Below DOCUMENT2.TXT is a PIPE delimited file I saved using
TEXTPAD with the textpad endoding option UNICODE. When read with the
FILENAME option ENCODING=UNICODE it works. Without the option the
imported data set has a space between each character.
filename ft14f001 "C:\Documents and Settings\&sysuserid\My
proc import datafile=FT14F001 replace out=work.test2 dbms=dlm;
On 7/11/08, Bucher Scott <SBucher@schools.nyc.gov> wrote:
> Do you mind sending the FILENAME statement to the list? I can't find it
> as part of the thread, and have encountered the same problem lately.
> Many thanks.
> -Scott Bucher
> -----Original Message-----
> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
> data _null_,
> Sent: Friday, July 11, 2008 4:55 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Re: Reading a Unicode File into SAS 9.1
> I'm not sure exactly what you are asking about today. Did you see my
> follow-up where I used the FILENAME statement option ENCODING=UNICODE to
> successfully read the UNICODE file.
> On 7/11/08, Anthony Pitruzzello <email@example.com> wrote:
> > Many thanks to those who responded to my original post about problems
> > reading a pipe delimited file.
> > (See original post below.)
> > data_null respond...Re: Reading Unix format files in Windows SAS #2
On Wed, 16 Jan 2008 12:22:20 -0800, Minehart, David
>We're moving from SAS 8.01 on Sun to SAS 9.1.3 on Windows. I've FTP'd
>the SAS programs, databases, and format files to my Windows server, but
>am having trouble reading the SAS format files associated with my
>databases. Is there some trick to this? Do I need to run a conversion
>program on them?
Alas, CEDA does not support foreign SAS Catalog files such as format
catalogs create on a different OS. I guess you can create a transport file
using proc cport on your source(8 on sun) and convert it back in the
target(on 9 on win) with proc cimport. or convert the format catalog into a
control dataset and read using CEDA on the target side and feed into proc
format in order to re-create the format catalog on the target... either way,
it is less pleasant than just pushing the "easy" button and get it done... :-)
manual pages on CEDA at
migration Focus Area at
...Re: How can I read old SAS system file? #2
Duck-Hye Yang <dyang@CHAPINHALL.ORG> wrote:
> How can I read this old file named "crnlink.ssd01"?
> The following code did not work:
> libname master '/match/peoplematch/';
> proc print data=master.crnlink (obs=100);run;
That's a SAS V6 data set. You should have looked at the log and seen
what the error was. Try this variant of your own code:
libname master v6 '/match/peoplematch/';
proc print data=master.crnlink (obs=100);run;
However, you may not have the path to the directory specified quite