Help from the community would be appreciated.
I have four fields in an excel worksheets and 336 rows. I want to read them into my program. The following is the code:
Data stgcocxx.prov_types;
infile 'C:\SAS\Prov_type\Prov_Types.xlsx' truncover;
input CDE_PROV_TYPE_PRIM $ DSC_PROV_TYPE $ CDC_PROV_SPEC_PRIM $ DSC_PROV_SPEC $;
run;
The resulting log statements follow:
NOTE: The infile 'C:\SAS\Prov_type\Prov_Types.xlsx' is:
Filename=C:\SAS\Prov_type\Prov_Types.xlsx,
RECFM=V,LRECL=32767,File Size (bytes)=20892,
Last Modified=18Sep2018:15:27:54,
Create Time=18Sep2018:13:04:05
NOTE: 1 record was read from the infile 'C:\SAS\Prov_type\Prov_Types.xlsx'.
The minimum record length was 679.
The maximum record length was 679.
NOTE: The data set STGCOCXX.PROV_TYPES has 1 observations and 4 variables.
NOTE: Compressing data set STGCOCXX.PROV_TYPES increased size by 100.00 percent.
Compressed is 2 pages; un-compressed would require 1 pages.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
I see the following in the viewtable:
CDE_PROV_TYPE_PRIM DSC_PROV_TYPE CDC_PROV_SPEC_PRIM DSC_PROV_SPEC
PKU <carriage return> - garbage characters <blank> <blank>
Following is what should be in row 1:
01 | Transportation Provider | 001 | Air Ambulance |
Help and insight will be very much appreciated
Thank you.
Walt L
Thank you for quick and correct solution, Reeza.
WL
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.