LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 1996, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 8 Feb 1996 08:23:57 CST
Reply-To:     greg nelson <greg_nelson@INTERNET.GALLUP.COM>
Sender:       "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:         greg nelson <greg_nelson@INTERNET.GALLUP.COM>
Subject:      Re: direct read of SPSS/Windows system files
Comments: To: karpmanm.rced@GAO.GOV

This seems to come up a lot. The following macro will read either an SPSS .SAV or .POR file. Used in conjunection with the xlabels perl script (which is great!) these are really powerful in exchanging information with SPSS. (Note: I have only tested this with SPSS for Windows.....

--greg

/* Simple macro for reading SPSS *.sav or *.por file and creating a SAS Data Set */

%macro readspss(spssfile=,sasds=);

%* ----------------------------------------------*; %* Macro: Readspss Library=utilmac *; %* *; %* ----------------------------------------------*; %* *; %* Description: *; %* *; %* Simple macro for reading SPSS *.sav or *; %* *.por file and create a SAS Dataset *; %* *; %* ----------------------------------------------*; %* *; %* Parameters: *; %* *; %* SPSSFILE Name and location of SPSS *; %* Save or Portable file *; %* *; %* e.g., c:\spssdat\myfil.sav *; %* *; %* SASDS Name of SAS dataset you *; %* want to create *; %* *; %* ----------------------------------------------*; %* *; %* Examples: *; %* *; %* macro readspss(spssfile=c:\spssdat\myfil.sav, *; %* sasds=mydata) *; %* ----------------------------------------------*; %* *; %* Local Notes: *; %* *; %* GBN - Possible improvements: work on *; %* interface to open up dialog window and *; %* grab file selection from that window. *; %* *; %* GBN - Front-end with FRAME *; %* *; %* ----------------------------------------------*; %* *; %* Written/ Modify: *; %* *; %* Gregory Barnes Nelson 03NOV12995 *; %* *; %* ----------------------------------------------*;

%let spssfile=%upcase(&spssfile); %let sasds=%upcase(&sasds);

LIBNAME xxx spss %quote("&spssfile"); data &sasds; set xxx._first_; run;

%mend readspss;

* %readspss(spssfile=h:\projects\discover\test.sav, sasds=mysasds);

______________________________ Reply Separator _________________________________ Subject: direct read of SPSS/Windows system files Author: karpmanm.rced@GAO.GOV at Internet Date: 2/8/96 8:05 AM

Has anyone written SAS code to read SPSS/Windows' system files directly, which would bypass the need to create SPSS's ascii EXPORT files and then use SAS's SPSS engine?

thanks, Mitch Karpman, karpmanm.rced@gao.gov


Back to: Top of message | Previous page | Main SAS-L page