Learning SAS? Welcome to the exclusive online community for all SAS learners.

Problems reading date and missing records

Accepted Solution Solved
Reply
Regular Learner
Posts: 1
Accepted Solution

Problems reading date and missing records

When I run the code, I am able to upload 896 of the 960 records (spot checks show that the correct is data, just some of it is missing). Also, I am 1) unable to consistently fill in the date field, and 2) convert the SAS date to a "01/01/9999"

 

Thanks

 

************* Code *********************

DATA pests;
INFILE 'E:\My Documents\Students\Mamata\testdata5.dat' DLM = ',';
INPUT TRT $ Plot Rep Date MMDDYY10. PLB ALB SLB XLB YLB CONVLB VLB MELB BEB MPB GLW BLW SFl OLB;
* Calculate means by month for pest insects;

* Print the data set to make sure the file was read correctly;
PROC PRINT DATE = pests;
/* BY Plot;
VAR TRT Plot Rep Date PLB ALB SLB XLB YLB CONVLB VLB MELB BEB MPB GLW BLW SFl OLB;*/
TITLE 'Insect Pests';
RUN;


Accepted Solutions
Solution
a month ago
Super User
Posts: 2,049

Re: Problems reading date and missing records

Posted in reply to mmatisoff

see if this adjustment in your code helps or not:

 

DATA pests;
INFILE 'E:\My Documents\Students\Mamata\testdata5.dat' DLM = ',' truncover;
INPUT TRT $ Plot Rep Date : MMDDYY10. PLB ALB SLB XLB YLB CONVLB VLB MELB BEB MPB GLW BLW SFl OLB;
run;

View solution in original post


All Replies
Solution
a month ago
Super User
Posts: 2,049

Re: Problems reading date and missing records

Posted in reply to mmatisoff

see if this adjustment in your code helps or not:

 

DATA pests;
INFILE 'E:\My Documents\Students\Mamata\testdata5.dat' DLM = ',' truncover;
INPUT TRT $ Plot Rep Date : MMDDYY10. PLB ALB SLB XLB YLB CONVLB VLB MELB BEB MPB GLW BLW SFl OLB;
run;
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 160 views
  • 0 likes
  • 2 in conversation