🔒 This topic is solved and locked.
Need further help from the community? Please
sign in and ask a new question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 08-01-2018 12:34 PM
(7243 views)
I am working with data from the BRFSS and I am trying to get the formats file to run with the actual dataset. I have downloaded the code and files from the BRFSS website, however when I try to use the code I am getting an error: Invalid File. I will paste the code I am using below. Does anyone know what to do about this error?
***********************************************************************************
* FILE NAME: TRANSPRT.SAS *
* DESCRIPTION: THIS PROGRAM CONVERTS A SAS TRANSPORT FILE LOCATED AT <TRANSPRT> *
* LIBNAME, INTO A SAS DATABASE STORED AT <DATAOUT> LIBREF *
* REFERENCES: *
* INPUT DATAIN FILEREF OF TRANSPORT DATAFILE OF COMPLETES *
* OUTPUT DATAOUT.SASDATA SAS DATABASE VERSION OF TRANSPORT DATA AS *
* SPECIFIED IN <TRANSPRT> LIBNAME *
* UPDATED - 02/21/2007 *
***********************************************************************************;
********************************
* Clear Output and Log Windows *
********************************;
DM OUTPUT 'clear' continue;
DM LOG 'clear' continue;
**********************************
* DEFINE SAS ENVIRONMENT OPTIONS *
**********************************;
OPTIONS PAGENO=1 NOFMTERR;
***************************************
* CLEAR EXISTING TITLES AND FOOTNOTES *
***************************************;
TITLE ;
FOOTNOTE ;
RUN ;
******************************************************
* INSTRUCTIONS: *
* SPECIFY PATH OF WHERE TRANSPORT DATAFILE IS STORED *
* SPECIFY PATH OF WHERE SAS DATASET IS TO BE STORED *
******************************************************;
LIBNAME TRANSPRT XPORT 'C:\Users\tuk44889\Desktop\BRFSS2010';
*****************************************************************************
* EXAMPLE: *
* LIBNAME TRANSPRT XPORT 'C:\BRFSS\2010\CDBRFS10.XPT' *
* NOTE: MAKE SURE THE ASTERISK IS REMOVED BEFORE THE WORD LIBNAME AND *
* MAKE SURE THAT THE GREATER THAN AND LESS THAN SIGNS < > ARE REMOVED *
* FROM THE FILENAME STATEMENT *
* THE QUOTATION MARKS MUST BE THERE FOR THE PROGRAM TO WORK *
*****************************************************************************;
LIBNAME DATAOUT V7 'C:\Users\tuk44889\Desktop\BRFSS2010' ;
*****************************************************************************
* EXAMPLE: *
* LIBNAME DATAOUT 'C:\' *
* A SAS DATABASE WILL BE STORED AT C:\SASDATA.SAS7BDAT *
* NOTE: MAKE SURE THE ASTERISK IS REMOVED BEFORE THE WORD LIBNAME AND *
* MAKE SURE THAT THE GREATER THAN AND LESS THAN SIGNS < > ARE REMOVED *
* FROM THE LIBNAME STATEMENT *
* THE QUOTATION MARKS MUST BE THERE FOR THE PROGRAM TO WORK *
*****************************************************************************;
PROC COPY IN=TRANSPRT OUT=DATAOUT;
RUN;
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Libname xport expects the name of the transport file, not of a directory where the transport file is stored.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Libname xport expects the name of the transport file, not of a directory where the transport file is stored.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you this worked!