SAS Procedures

Help using Base SAS procedures
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
spiperato
Calcite | Level 5

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
2 REPLIES 2
spiperato
Calcite | Level 5

Thank you this worked!

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 7244 views
  • 0 likes
  • 2 in conversation