f



Re: PROC CONVERT spss. Too long variable names from SPSS to SAS #2

Now this makes since, its an SPSS thing and not SAS.  I know SAS can
handle lnames longer than 8 characters in length, and a quick check of
the help docs shouwed nothing that would indicate otherwise when using
Proc Convert.

Good thing to know.

Toby

-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Neerav
Sent: Wednesday, December 01, 2004 10:01 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: PROC CONVERT spss. Too long variable names from SPSS to SAS


Anders,
I have also had the same problem converting SPSS to SAS with the
variable names being truncated. The only solution I could find is by
renaming the variables manually to names 8 characters long, then
importing it and renaming it into SAS. I believe that SPSS automatically
truncates the variable names to 8 characters when creating portable
files, its something to check out and thats where the problem is.

Also, you should make sure your SPSS datafile does not have any 'user
defined' missing values (e.g. -1=N/A) as SAS will read all missing
values as system missing "." and you will lose those definitions. Hope
this helps.

Neerav
0
Toby.Dunn (894)
12/1/2004 4:08:04 PM
comp.soft-sys.sas 142827 articles. 4 followers. Post Follow

1 Replies
944 Views

Similar Articles

[PageSpeed] 45

With the later versions SPSS can now handle longer variable names.  Not
sure which version, maybe 12.0, started with that, but I do know that
12.0.2 Help says, "The length of a names cannot exceed 64 bytes.

Sixty-four bits typically means 64 characters in single-byte languages
(for example, English, .....) and 32 characters in double-byte languages
(for example, Japanese, Chinese, Korean)."

HTH,
                                                                                
Necia A. Black, Ph.D.     	e-mail:  black@buffalo.edu      
246 Computing Center          	Web URL:http://www.acsu.buffalo.edu/~black
SUNY-Buffalo                  	FAX:     (716) 645-3734
Buffalo, New York 14260       	Phone:   (716) 645-3572

On 1 Dec 2004, Dunn, Toby wrote:

> Now this makes since, its an SPSS thing and not SAS.  I know SAS can
> handle lnames longer than 8 characters in length, and a quick check of
> the help docs shouwed nothing that would indicate otherwise when using
> Proc Convert.
> 
> Good thing to know.
> 
> Toby
> 
> -----Original Message-----
> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
> Neerav
> Sent: Wednesday, December 01, 2004 10:01 AM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Re: PROC CONVERT spss. Too long variable names from SPSS to SAS
> 
> 
> Anders,
> I have also had the same problem converting SPSS to SAS with the
> variable names being truncated. The only solution I could find is by
> renaming the variables manually to names 8 characters long, then
> importing it and renaming it into SAS. I believe that SPSS automatically
> truncates the variable names to 8 characters when creating portable
> files, its something to check out and thats where the problem is.
> 
> Also, you should make sure your SPSS datafile does not have any 'user
> defined' missing values (e.g. -1=N/A) as SAS will read all missing
> values as system missing "." and you will lose those definitions. Hope
> this helps.
> 
> Neerav
> 
> 

0
black5767 (17)
12/1/2004 9:15:59 PM
Reply:

Similar Artilces:

Re: PROC CONVERT spss. Too long variable names from SPSS to SAS
Why use proc convert? The following will read in a SAS file (okay, so I did it for a SAS .xpt file, but I think it will work on all SAS files? ) libname xxx spss 'C:\Projects\rawdata\spssfile1.por'; *FULL filename; libname anal 'C:\Projects\analysis_datasets'; *folder location where data will be stored; Data anal.sasfile1; *saves file (named sasfile1) in SAS format in location defined above; set xxx.data; *sets file from SPSS into that file; HTH! Venita > ---------- > From: Anders J[SMTP:anderj@STUD.NTN...

Re: PROC CONVERT spss. Too long variable names from SPSS to SAS #3
Another idea may be to create a comma-delimited file from the SPSS dataset to read into SAS. Or use DBMS/Copy. John Gerstle CDC Information Technological Support Contract (CITS) Biostatistician >> -----Original Message----- >> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of >> Neerav >> Sent: Wednesday, December 01, 2004 11:01 AM >> To: SAS-L@LISTSERV.UGA.EDU >> Subject: Re: PROC CONVERT spss. Too long variable names from SPSS to SAS >> >> Anders, >> I have also had the same problem converting SPSS to SAS with the &...

PROC CONVERT spss. Too long variable names from SPSS to SAS
Hallo I need to import a spss data file into SAS. I works just fine except from the the spss variable names being longer than eight characters and are thus renamed to a length of eight in SAS. Does anybody know how I can circumvent this problem? I need variable names of at least length 25 characters. By the way I'm using SAS 9.1! This is my code: filename myfile 'C:\bank\test.por'; proc convert spss=myfile out=work.vv; run; Thanks Anders Norway Why use proc convert? The following will read in a SAS file (okay, so I did it for a SAS .xpt file, but I think it will work on all...

Re: SAS Formats
Karan Karan Bhatia wrote: > Is SAS formats analogous to "Variable & Value Labels" of SPSS. Yes even if in separated files in sas solution > > I have a SAS dataset for which I also have SAS formats separately and I want > to convert it into SPSS data but unable to get value labels. Your code was working in the past but there were many changes into spss rules from version 10 until 13 see my mails on sas-l about this (20/2/2002 ... 21/1/2005) in version 11 you must try GET SAS DATA='E:\USERDATA\folder\dataset.sas7bdat' /FORMATS = 'E:\USERDATA\fo...

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: convert SPSS to SAS #2
that is also my problem: if that is a message of proc import, that thing can only come from the source (the output table is new!). That implies that SPSS also has formats (?) like SAS. I don't know SPSS, so I can't say. If it is similar to SAS, there must also be a format catalog (?) with user-formats. Maybe that can also be imported. Gerhard On Tue, 27 Oct 2009 18:18:09 +0100, Andre Wielki <wielki@INED.FR> wrote: >Darren >see inyour work >normaly you have a format catalog > >then >to open your newfilename sas table (probably no more in the work) you >mus...

Re: urgent : Convert SAS array in to sas variables #2
On Sat, 3 May 2008 23:34:44 -0700, Shailesh <shailesh.tewari@GMAIL.COM> wrote: >In my dataset I have an array variable , say A which has values like >Observation 1 - A[1]= 23 ,A[2]=34, A[3]=45 >Observation 2 - A[11]= 23 ,A[12]=34, A[13]=45 > >I want to create sas variables which should have name A61, A62 , A63, >A64 .......... >Similarly for second observation these would be A71, A72, >A73 , A74......... > > >in the same datastep. > >Any help ? > >Regards, >Shailesh Arrays are DATA *step* structures. They do not exists in data *...

Re: SAS Formats
Hi Karan, SAS formats are more than SPSS value labels. In SPSS, as you may know, value labels only associate a textual label with a (numerical) value, that's all. And with (statistical) procedures both the value and its label may be printed. SAS formats can be viewed as some kind of transformation of (numerical and character) values, often intended for representation purposes (like value labels, but also quite often for conversion purposes. See the SAS docs, it's too extensive. With SAS PROCs generally only either unformatted values or formatted values are being displayed. Briefly, ...

Re: SAS Formats
Karan, If you are running SAS interactively, you can view the files in the SAS explorer window if you first execute the statement Options nofmterr; This will allow you to open the file for viewing without having the format catalog. Daniel J. Nordlund Research and Data Analysis Washington State Department of Social and Health Services Olympia, WA 98504-5204 -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Karan Bhatia Sent: Tuesday, July 19, 2005 2:48 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: SAS Formats - converting SAS dataset into SPSS ...

Re: SAS Formats
Hi Jim, Thanks for your prompt reply on SAS-L. I do not have formats as code, but as "formats.sasb7cat" which appears with a icon of a folder with a red dot at lower right corner. I feel its similar to a zip file. I know how to use formats code to convert it to SPSS value label code using a text editor, but don't know how to use this. I am using SAS 8.2 and SPSS 12. Thanks, Karan Karan Bhatia | karan@absolutdata.net; AbsolutData Technologies Inc. | http://www.absolutdata.net +91.11.5163.6400 Ext - 338 (Intl Dialing) +510.903.1026 Ext - 338 (US Dialing) -----Original Messa...

Re: SAS Formats
Hi Karan, Well, then you have a format catalog, in its specific format, of which you could make a SAS dataset using the (LIBRARY and) CNTLOUT option of PROC FORMAT. From the dataset you could try to generate text in the form of SPSS value labels. Maybe there are, but I don't know of it, other ways SPSS can handle SAS formats. It's been 9 years since I lastly used SPSS (four win does). Regards - Jim. -- Y. (Jim) Groeneveld, MSc., Biostatistician, Vitatron b.v., NL Jim.Groeneveld_AT_Vitatron.com (replace _AT_ by AT sign) http://www.vitatron.com, http://home.hccnet.nl/jim.groeneveld My...

Re: Problems converting spss file to sas #2
On Tue, 25 Mar 2008 15:09:19 -0400, Simon, Lorna <Lorna.Simon@UMASSMED.EDU> wrote: >I am having trouble converting an spss file to sas. The problem is with my date variables. When I run a freq on them they print out as follows: > 09:47 Tuesday, March 25, 2008 1393 > >The FREQ Procedure > > Birthdate of Subject > > Cumulative Cumulative > brth_dat Frequency Percent Frequency Percent >���������������������������������������������������������������� >12527222400 ...

Re: Converting SPSS program syntax to SAS syntax #2
Charlie: I last worked with an SPSS DE application over a decade ago, so I can't claim to know what SPSS DE features today. I'd guess that older applications don't do much that cannot be replicated quickly in a Web (Internet or intranet) application and run on a standard Apache server or MS ISS. DE of statistical information rarely has to be tied to a statistical program since most formats and validations have equivalents in Javascript, VB script, or other HTML scripting programs, and conversions of ASCII, RDBMS, Excel, etc. data sources to SAS have become routine. Conversion of S...

Re: R vs. SAS (was Replacement for SAS (SPSS vs. SAS, redux))
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, and it's also great, but the mood is different; r-help is less welcoming to newbie questions, silly questions, badly worded questions, not directly on topic questions, and so on. Dealing with large data sets - I don't do this much, b...

Re: Assign variables to a new variable based on variable names in SAS #2
V - http://v8doc.sas.com/sashtml/macro/z0210258.htm You can create a macro variable with the SYMPUT routine and use RESOLVE to resolve it in the same DATA step. %let event=Holiday; %macro date; New Year %mend date; data test; length var1-var3 $ 15; when='%date'; var1=resolve('&event'); /* macro variable reference */ var2=resolve('%date'); /* macro invocation */ var3=resolve(when); /* DATA step variable with macro invocation */ put var1= var2= var3=; run; hth Paul Choate DDS Data Extraction (916) 654-2160 -----Original Message-----...

Re: R vs. SAS (was Replacement for SAS (SPSS vs. SAS, redux)) #4
No, sorry if I made it sound that way..... SAS and R are totally different in the way they work, how they are structured, what the statements look like, and so on. Not like French and Spanish, not even like English and Spanish. More like English and Swahilli. R has a lot in common with S Plus, both are based on the S language. But there is no hostility that I know of between S Plus and R (unlike the situation with Linux) Peter >>> <ben.powell@CLA.CO.UK> 2/5/2004 10:36:32 AM >>> wrote Sounds like R is the SAS equivalent of Linux .. who are incidentally in all sort...

Re: R vs. SAS (was Replacement for SAS (SPSS vs. SAS, redux)) #5
I think that SAS and R are very similar, even though their designs are very different. What matters is that both can be used to accomplish the same things - just as English and Swahilli serve the same purpose (communication) equally well. As for the copyleft "mess", do you really believe the propaganda and outright lies perpetrated by some companies? Remember, they want you to pay $$$ for your software, and copyleft poses a huge threat to that goal. -----Original Message----- From: Peter Flom [mailto:flom@NDRI.ORG] Sent: Thursday, February 05, 2004 12:57 PM To: SAS-L@LISTSERV.UGA....

Re: R vs. SAS (was Replacement for SAS (SPSS vs. SAS, redux)) #3
Wow, that was a leap. Better not use Apache or PHP then. Andy >-----Original Message----- >From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On >Behalf Of ben.powell@CLA.CO.UK >Sent: Thursday, February 05, 2004 10:37 AM >To: SAS-L@LISTSERV.UGA.EDU >Subject: Re: R vs. SAS (was Replacement for SAS (SPSS vs. SAS, redux)) > >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 a...

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 on yours. Try 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: >Hi All, > >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! > >SAS 8.2: >libname bb dbaccess 'x:\a\b\c\d.mdb' bbb='asdfgh >zxcvbn'; >libname cc dbaccess 'x:\a\b\c\d.mdb' ccc='asd zxc'; > >proc sql; > cre...

Re: Converting Macro Variable to a SAS Dataset Variable #2
Sounds like you should address this at the step where you create the macro variable; instead of creating a macro variable, create a dataset (or a dataset variable). (I assume this is related to your other query, which indicates that you create this macro variable in PROC SQL). Can you post some code and sample data for how you arrive at &p1 in the first place? -Joe On Wed, Mar 18, 2009 at 10:22 AM, Siddharth Jain <sjain@aveopharma.com>wrote: > If I have a macro variable p1 where %put <<p1>>; results in <<p1>> > 01,02,03,06 > > > How do I br...

Re: convert SPSS to SAS
Darren see inyour work normaly you have a format catalog then to open your newfilename sas table (probably no more in the work) you must before submit this options fmtsearch=(work.formats); did this solve your problem or was this message a message of proc import? Andre darren Brust a �crit : > I used the following code to convert SPSS file to SAS dataset > > PROC IMPORT DATAFILE='temp.sav' > OUT=work.newfilename > DBMS=SAV replace; > RUN; > > but I cannot get the formats loaded. > > the error message: 'ERROR: The format D27B was not found or could...

Re: SAS 9.2: PROC MEANS with Character Variables #2
that makes not much sense: VAR should be reserved for numeric variables to calculate statistics. Simply leave that statement off and leave only output out=x; in. Gerhard On Wed, 3 Sep 2008 08:33:35 -0700, Paige Miller <paige.miller@KODAK.COM> wrote: >On Sep 3, 10:47 am, jcl...@HILLTOP.UMBC.EDU (Jack Clark) wrote: > >> I think the doc is talking about all the variables in the data set, not >> the variables on the VAR statement. > >No. This doesn't work on data sets where all the variables are >character. > >> When I need to see the distribut...

Re: SAS 9.1.2 difference from SAS 8.2 Proc import from MS Access
Hi, We are having the same problems. We have some macros that are srewed up. Is there a way to configure SAS 9 so that it can use version 8 values when importing from MS access? Thanks very much. wz ...

Re: urgent : Convert SAS array in to sas variables
Shailesh, Why would you want to do what you ask? What you are asking would create the variable for all observations, but the variables' values would be missing values for every observation except the one on which it is based. Art ----- On Sat, 3 May 2008 23:34:44 -0700, Shailesh <shailesh.tewari@GMAIL.COM> wrote: >In my dataset I have an array variable , say A which has values like >Observation 1 - A[1]= 23 ,A[2]=34, A[3]=45 >Observation 2 - A[11]= 23 ,A[12]=34, A[13]=45 > >I want to create sas variables which should have name A61, A62 , A63, >A64 .......... >...