🔒 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 11-29-2020 04:02 PM
(940 views)
data traffic2;
infile "/folders/myfolders/np_traffic.dat" dlm='|';
input Parkname$ Unitcode$ ParkType$ Region$TrafficCounter$ Reportdate$ TrafficCount;
run;
when I use the codes above to import np.traffic.dat to sas, the top labels (Parkname$ Unitcode$ ParkType$ Region$TrafficCounter$ Reportdate$ TrafficCountis) are exactly repeated as the labels of SAS dataset. What is the better way to avoid the repeating label and the first row immediately starts with the real data?
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@anming - Yes, FIRSTOBS.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Adding OBS = 2 to your INFILE statement tells SAS to start reading data from the second record:
infile "/folders/myfolders/np_traffic.dat" dlm='|' obs = 2;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
should be added "firstobs=2". Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@anming - Yes, FIRSTOBS.