/* SAS Program to read Postal Codes and ID numbers into SAS for use with PCCF+ Version 6A1 */ /* */ /* 'libname' sets up a place (myownlib) on my hard drive where my datasets will be stored */ /* versus only keeping data for the duration of the SAS session */ libname myownlib 'C:\Users\moonj\Desktop\PCCF6A1\Sample'; /* 'filename' assigns a nickname (pcodes) to the text file containing data & tells SAS where to find it */ filename pcodes "C:\Users\moonj\Desktop\PCCF6A1\Sample\pcodes1.txt"; /* In this example, the data file is called 'pcodes1.txt' */ /* the file 'pcodes1.txt' must have a 6 digit Postal Code, a space, and an ID number, in each row */ /* A0A1C0 1203123810 A0A1G0 1201122910 A0A1J0 1204046131 A0A1M0 1201013932 A0A1P0 1201228732 A0A1W0 1202007032 */ /* The 'data' statement creates a dataset, 'testdata1', in the library 'myownlib' */ /* Because of the two-part name, the dataset 'testdata1.sas7bdat' will be stored on my hard drive in the */ /* location defined by the libname statement ('C:\Users\moonj\Desktop\PCCF6A1\Sample') */ data myownlib.testdata1; length PCODE $ 6 ID $10; * defines variable lengths; infile pcodes; * tells SAS where to look for the data; input PCODE $ ID $; * inputs the data; format PCODE $6. ID $10.; * formats the variables; label PCODE=PCODE ID=ID; * labels the variables; proc print; run;