Category: Chapter X – Appendices – Programs

Program A1.1

/***********************************************************************************
* This program is taken from the following book. If using please cite it as:           *
* Emrouznejad, A. and W. Ho (2012). Applied Operations Research with SAS, *
* CRC Press: Taylor Francis Ltd, ISBN: 9781439841303.                                               *
* For details please visit: http://www.sas-or.com.                                                                *
************************************************************************************/


* Program A1.1: An example of PROC IMPORT;
* Import Data from a Comma-Delimited Text File;

proc import
datafile = “c:/sasor/mydata.csv”
out = mydata
dbms = csv
replace;
getnames = yes;
run;


/****************************************************************************
******************************END of the program*****************************
****************************************************************************/

Permanent link to this article: http://sas-or.com/book/program-a1-1

Program A1.2

/***********************************************************************************
* This program is taken from the following book. If using please cite it as:           *
* Emrouznejad, A. and W. Ho (2012). Applied Operations Research with SAS, *
* CRC Press: Taylor Francis Ltd, ISBN: 9781439841303.                                               *
* For details please visit: http://www.sas-or.com.                                                                *
************************************************************************************/


* Program A1.3: An example of PROC IMPORT;
* Import Data from a Tab-Delimited Text File;

proc import
datafile = ”c:/sasor/mydata.txt”
out = mydata
dbms = tab
replace;
getnames = yes;
run;


/****************************************************************************
******************************END of the program*****************************
****************************************************************************/

Permanent link to this article: http://sas-or.com/book/program-a1-2

Program A1.3

/***********************************************************************************
* This program is taken from the following book. If using please cite it as:           *
* Emrouznejad, A. and W. Ho (2012). Applied Operations Research with SAS, *
* CRC Press: Taylor Francis Ltd, ISBN: 9781439841303.                                               *
* For details please visit: http://www.sas-or.com.                                                                *
************************************************************************************/


* Program A1.3: An example of PROC IMPORT;
* Import Data from a Space-Delimited Text File;


proc import
datafile = ”c:/sasor/mydataspace.txt”
out = mydata
dbms = dlm
replace;
getnames = yes;
run;


/****************************************************************************
******************************END of the program*****************************
****************************************************************************/

Permanent link to this article: http://sas-or.com/book/program-a1-3

Program A1.4

/***********************************************************************************
* This program is taken from the following book. If using please cite it as:           *
* Emrouznejad, A. and W. Ho (2012). Applied Operations Research with SAS, *
* CRC Press: Taylor Francis Ltd, ISBN: 9781439841303.                                               *
* For details please visit: http://www.sas-or.com.                                                                *
************************************************************************************/


* Program A1.4: An example of PROC IMPORT;
* Import Data from an EXCEL File;


proc import
datafile = ”c:/sasor/mydataspace.txt”
out = mydata
dbms = EXCEL2000
replace;
getnames = yes;
run;


/****************************************************************************
******************************END of the program*****************************
****************************************************************************/

Permanent link to this article: http://sas-or.com/book/program-a1-4

Program A1.5

/***********************************************************************************
* This program is taken from the following book. If using please cite it as:           *
* Emrouznejad, A. and W. Ho (2012). Applied Operations Research with SAS, *
* CRC Press: Taylor Francis Ltd, ISBN: 9781439841303.                                               *
* For details please visit: http://www.sas-or.com.                                                                *
************************************************************************************/


* Program A1.4: An example of PROC EXPORT
* Export Data from SAS to Other Formats;

proc export
data = mydata
outfile = ’c:/sasor/mydatout.txt’
dbms = dlm
replace;
delimiter = ’,’;
run;


/****************************************************************************
******************************END of the program*****************************
****************************************************************************/

Permanent link to this article: http://sas-or.com/book/program-a1-5