BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
desireatem
Pyrite | Level 9

data date;
input id $ DD;
cards;

GC135  1/8/2010
GC125   6/18/2009
GC580 3/14/2013
GC439 7/6/2011
GC425 12/17/2013
GC439 5/26/2009
GC691 8/17/2011
GC676 8/9/2012
GC733 11/30/2012
GC425 3/25/2010
GC580 3/27/2012
GC332 11/9/2010
GC418 1/13/2009
GC276 6/24/2010
GC408 12/2/2008
GC439 8/27/2012
GC543 11/22/2011
GC733 10/14/2011
GC360 7/11/2011
GC408 4/23/2012
GC125 9/14/2011
GC408 1/11/2010
GC125 10/18/2012
GC425 5/5/2011
GC692 8/17/2011
GC698 11/14/2012
GC755 11/4/2011
GC332 7/30/2009
GC052 9/19/2013
GC139 6/5/2012
GC276 5/5/2009
GC426 3/23/2010
GC852 6/28/2012
GC755 6/25/2013
GC533 9/16/2010
GC135 5/13/2013
GC338 4/19/2012
GC425 7/24/2012
GC096 8/29/2011
GC096 9/12/2013
GC592 12/16/2010
GC096 6/28/2010
GC760 11/9/2011
GC695 8/30/2011
GC695 10/2/2012
GC386 12/20/2013
GC698 8/31/2011
GC125 9/16/2013
GC695 9/5/2013
GC411 6/18/2012
GC197 1/14/2011
GC439 9/24/2013
GC440 6/5/2012
GC409 6/10/2013
GC760 12/4/2012
GC409 1/19/2010
GC404 2/28/2012
GC439 5/11/2010
GC096 9/26/2012
GC096 4/3/2009
GC332 2/10/2012
GC440 5/29/2013


run;

data date;
format DD mmddyy10.;
date_number=DD;
run;

proc sort data=date;
by id;
run;


ERROR: Connect: Class not registered
ERROR: Error in the LIBNAME statement.
NOTE: Attachments for -3 reestablished for new parent.
NOTE: Import Cancelled.
436  data date;
437  input id    DD
438  cards;

NOTE: Invalid data for id in line 439 1-5.
NOTE: Invalid data for Date in line 439 9-18.
RULE:      ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----
439        GC733   12/13/2013
id=. Date=. _ERROR_=1 _N_=1
NOTE: Invalid data for id in line 440 1-5.
NOTE: Invalid data for Date in line 440 9-17.
440        GC418   7/25/2011
id=. Date=. _ERROR_=1 _N_=2
NOTE: Invalid data for id in line 441 1-5.
NOTE: Invalid data for Date in line 441 9-17.
441        GC418   8/22/2012
id=. Date=. _ERROR_=1 _N_=3
NOTE: Invalid data for id in line 442 1-

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

This works for me:


data date;

informat DD anydtdte.;

format DD date9.;

input id $ DD;

cards;

GC135  1/8/2010

GC125   6/18/2009

GC580 3/14/2013

GC439 7/6/2011

GC425 12/17/2013

GC439 5/26/2009

;

run;

View solution in original post

3 REPLIES 3
Reeza
Super User

This works for me:


data date;

informat DD anydtdte.;

format DD date9.;

input id $ DD;

cards;

GC135  1/8/2010

GC125   6/18/2009

GC580 3/14/2013

GC439 7/6/2011

GC425 12/17/2013

GC439 5/26/2009

;

run;

desireatem
Pyrite | Level 9

I still have error on proc sort. It can not find id variable. it state : id variable not found

Reeza
Super User

Post your log/code then.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 765 views
  • 0 likes
  • 2 in conversation