Re: how to read this file into sas #2

Read the file in its orginal form and Proc Transpose is one alternative...

On Thu, 14 Sep 2006 17:09:52 -0700, liuyuanpku@GMAIL.COM wrote:

>Hi, I just got a problem to read a txt file into sas. The structure of
>the data in txt file is:
>family member
>1 3809 3810 3811 3812
>2 3814 3815 3816
>3 3817 3818 3819 3820
>When I read it into sas, I want it in the following structure:
>family member
>1 3809
>1 3810
>1 3811
>1 3812
>2 3814
>2 3815
>2 3816
>3 3817
>3 3818
>3 3819
>3 3820
>How can I get this sas data?
>Thanks a lot!
hari_s_nath (366)
9/15/2006 1:04:17 AM
comp.soft-sys.sas 142828 articles. 3 followers. Post Follow

0 Replies

Similar Articles

[PageSpeed] 56


Similar Artilces:

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. Art -------- 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
Hi Ace, 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. Mark Terjeson Investment Business Intelligence Investment Management & Research Russell Investments 253-439-2367 Russell Global Leaders in Multi-Manager Investing -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Ace Sent: Wednesday, October 14, 2009 5:49 AM To: SAS-L@LISTSERV.UGA.EDU 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. Gerhard On Tue, 18 Mar 2008 06:43:44 -0700, RolandRB <rolandberry@HOTMAIL.COM> wrote: >Is it possible to read a sas dataset NOT using sas and have >observations and variables etc. rather than having meaningless chunks >of text? ...

Re: Opening non SAS files with BASE SAS ? #2
Hi, If, when you check your licensing(i.e. SETINIT) proc setinit; run; 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. http://listserv.uga.edu/cgi-bin/wa?A2=ind0709C&L=sas-l&P=R12721 http://listserv.uga.edu/cgi-bin/wa?A2=ind0105D&L=sas-l&P=R13103 The X command in SAS can run external commands but the SQL-passthrough is what most of us use. Hope this is helpful. Mark Terjeson Senior Programmer Analyst, IM&R Russell Investments Russell Investments Global Leaders in Multi-Manager Investing -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of anderson115@GMAIL.COM Sent: Wednesday, October 10, 2007 12:43 PM To: SAS-L@LISTSERV.UGA.EDU 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? Thank You, Aaron ...

Re: Reading SAS files from other programs #2
Hi Mark, Have a look at the database converters DBMS/copy (Dataflux) and StatTransfer. Regards - Jim. -- Jim Groeneveld, Netherlands Statistician, SAS consultant home.hccnet.nl/jim.groeneveld On Thu, 27 Apr 2006 12:56:57 -0400, Coleman, Mark <Mark.Coleman@LIBERTYMUTUAL.COM> wrote: >Greetings, > >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? > >Thanks, > >Mark ...

Re: Reading RTF files with SAS #2
Jake, I've never looked at the macro, but take a look at: www2.sas.com/proceedings/sugi31/066-31.pdf Art -------- 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) > >Jake ...

Re: how to read gzip file in SAS #2
Hi, Howard, 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? Thanks. Best, Rong On 11/1/07, Howard Schreier <hs AT dc-sug DOT org> <nospam@howles.com> wrote: > > On Thu, 1 Nov 2007 12:21:58 -0400, wraong <wrong.wang@GMAIL.COM> wrote: > > >Hi,all, > > > >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. > > > >Best, > >Rong > > 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. HTH. On 8/8/05, Joan Zhao <jlin104@hotmail.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
Mona 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 http://www.vasug.org/Proceedings/2003-02/Presentations/EXTRACTING%20DATA%20FROM%20PDF%20FILES.doc 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. Good luck. Nat Wooding 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> wrote: >Hello, > >I am using SAS Unix Display manager. >I put together single small sas programming files in one giant sas programming file. >I need to save log and output files AFTER each single small programming file. >The problem is that I do not know how to save log and output while in SAS session. > >Below is the outline of what I'd like to do: > > >DM 'clear log'; >DM 'clear output'; >SAS 1 programming start here >end 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: %macro doit(stmt1=,stmt2=); ..... &stmt1 ..... &stmt2 ..... %mend; %doit(stmt1=%str(y=sqrt(y);), 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: data a; %inc(inc1); %inc(inc2); %inc(inc3); run; ??? instead of: data a; set sashelp.class; if age>11 then age=11; keep name age; run; Gerhard On Mon, 9 Jun 2008 01:42:03 -0700, Joep Steeman <jsteeman@BUSINESSDECISION.COM> wrote: >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 Release(s) Fixed: Date Created: 28JUL2008 Date Last Updated: 11AUG2008 http://support.sas.com/kb/32792.html To subscribe, go to http://support.sas.com/techsup/news/snotes.html You'll get an extra email on most workdays, but if you subscribe to SAS-L you'll hardly notice one more. There's also http://support.sas.com/techsup/news/tsnews.html 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 http://support.sas.com/community/rss/index.html On Mon, 25 Aug 2008 11:10:05 -0400 (GMT-04:00), "Peter Flom" <peterflomconsulting@mindspring.com> said: > Hi Jack > > I don't think I've ever looked at tech support notes ..... where is it? > Is it useful for browsing? > > Peter > > -----Original Message----- > >From: Jack Hamilton <jfh@alumni.stanford.org> > >Sent: Aug 25, 2008 11:08 AM > >To: Peter Flom <peterflomconsulting@mindspring.com>, "sas-l@listserv.uga.edu" <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
John: 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. Sig -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of John Bentley Sent: Monday, October 18, 2004 10:10 AM To: SAS-L@LISTSERV.UGA.EDU 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 >To: SAS-L@LISTSERV.UGA.EDU > >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 */ proc datasets; delete &out; run; quit; /* MANIPULATION THE STRING OF FOLDER PATH */ data _null_; dir1 =3D...

Re: Creating SAS datasets from reading a file #2
Chandra, 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"|| " dwproject_"||state||";" into :data_st separated by ' ', :if_st separated by ' ' from stlist.del ; quit; data &data_st.; set del; &if_st.;; run; HTH, Art ------- On Fri, 11 Jul 2008 15:08:19 -0400, SUBSCRIBE SAS-L Chandra Gadde <ddraj2015@GMAIL.COM> wrote: >Nat, > >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 >that file. > > > >On Fri, 11 Jul 2008 15:05:43 -0400, Nat Wooding <Nathaniel.Wooding@DOM.COM> >wrote: > >>Interesting -- this is around the third time today that this question has >>come up. You could use the approach >> >>Data dwproject_NY >> dwproject_md etc ; >> >>infile ... >>input ...; >> >>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 <janexue@WESTAT.COM> wrote: >Wish this could hlep some: > >DATA stlist; > st="FL"; output; > st="TX"; output; > st="NY"; output; > st="VA"; output; >RUN; > >PROC SQL; > SELECT st INTO :stlist SEPARATED BY " " > FROM stlist; > SELECT count(*) into :totalst > FROM stlist; >QUIT; > >%PUT &stlist. &totalst.; > >%MACRO GetDateset; > %DO n=1 %TO &totalst.; > %LET st=%SCAN( &stlist., &i ); > DATA data_for_&st.; > infile '..........'; > if .....=&st. then output; > RUN; > %END; >%MEND; >%GetDataset ...

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: > > http://www.sascommunity.org/wiki/Category:V9.2_Phase_2 > > http://www.sascommunity.org/wiki/V9.2_Phase_2_install_guide > > 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
Hi Jon, 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 home.hccnet.nl/jim.groeneveld 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> wrote: >Hi - > >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. > >Jon ...

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?= <rune@FASTLANE.NO> wrote: >/* >This is the file with the fileref MYFILE: > >--------------------------------------- >DOKTITTEL: this is the first record >--------------------------------------- >DOKTITTEL: . >--------------------------------------- >DOKTITTEL: this is the third record >--------------------------------------- >*/ > >/* >I want the second record to be '.', not ' '. >How can I obtain that? > >Rune >*/ >filename myfile "d:\temp\myfile.txt"; > >data tp34_jn_dok; > length Dokumentbeskrivelse $40. ; > infile myfile dlm=">>>" pad ; > input @"DOKTITTEL:" dokumentbeskrivelse ; >run; 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 Documents\Document2.txt" encoding=unicode; proc import datafile=FT14F001 replace out=work.test2 dbms=dlm; delimiter='|'; getnames=no; run; 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 <tonypit45@yahoo.ca> 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 <David.Minehart@ITRON.COM> wrote: >Hi, > >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? hi, david, 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... :-) cheers, chang p.s. manual pages on CEDA at http://support.sas.com/onlinedoc/913/getDoc/en/lrcon.hlp/a002200731.htm migration Focus Area at http://support.sas.com/rnd/migration/index.html ...

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 ...

Web resources about - Re: how to read this file into sas #2 - comp.soft-sys.sas

Read-Only Memory
Read-Only Memory publishes high-quality books and articles that document defining moments in videogame history.

Read All About It! - Wikipedia, the free encyclopedia
Read All About It! was a Canadian educational television series that was produced from 1979 to 1983 by TVOntario that aired during the early ...

First Read
The first place for news and analysis from the NBC News Political Unit. Follow us on Twitter.

First Read
The first place for news and analysis from the NBC News Political Unit. Follow us on Twitter.

WhatsApp Lets Users Know When Messages Are Read
Users of Facebook-owned cross-platform messaging application WhatsApp can now tell when their messages have been read. (more…) New Career Opportunities ...

Canada Reads author Tracey Lindberg speaks to First Nations students in Thunder Bay
Don't take no for an answer when it comes to pursuing your dreams, Canada Reads author, and University of Ottawa law professor Tracey Lindberg ...

Must read: top 10 Android stories of the week
Android N is out, and N stands for nut tellin’! Google dropped a bombshell this week: a very early preview of Android N that we’re still digging ...

Interesting Read: “Why Team Clinton’s not sweating Trump”
Yes, it’s Politico . But, while I haven’t been able to listen to the podcast, the write-up is still worth reading. Glen Thrush interviews “Hillary ...

The Donald Trump we don't get to see: The Donald Trump "that sits, and reads and thinks."
... are two Donald Trumps. I think there's one Donald Trump. But certainly you have all of this, and you have somebody else that sits, and reads ...

read Richard Hell's statement on Ivan Julian ahead of cancer benefit show
"It’s horrible that he has to suffer some terribly painful, life-threatening illness, and have it ravage him financially as well. American barbarism. ...

Resources last updated: 3/18/2016 8:40:24 AM