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

Hello,

 

I have imported code below.   But the log page showed error message below.  Please advice how to fix it.

 

Data residences;
      infile  "\\Pathway\ResidencesDates.csv" dlm="," dsd missover lrecl=32000 firstobs=2;
;
input 
      Id
      ResStartMM_1
      ResStartYY_1
      ResStopMM_1
      ResStopYY_1
	  ;
Format  ResStartMM_1 DateMM.;
Format  ResStartYY_1 DateYY.;
Format  ResStopMM_1 DateMM.;
Format  ResStopYY_1 DateYY.;
Label  ResStartMM_1="Residence Start Date Month";
Label  ResStartYY_1="Residence Start Date Year";
Label  ResStopMM_1="Residence Stop Date Month";
Label  ResStopYY_1="Residence Stop Date Year";
RUN;

 

The error message in the Log page:

 

45 Format ResStartMM_1 DateMM.;

                                          -------

                                          48

ERROR 48-59: The format DATEMM was not found or could not be loaded.

46 Format ResStartYY_1 DateYY.;

                                         -------

                                         48

ERROR 48-59: The format DATEYY was not found or could not be loaded.

47 Format ResStopMM_1 DateMM.;

                                          -------

                                          48

ERROR 48-59: The format DATEMM was not found or could not be loaded.

48 Format ResStopYY_1 DateYY.;

                                         -------

                                         48

ERROR 48-59: The format DATEYY was not found or could not be loaded.

1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star

Months and years are numeric variables that don't need formats.

 

Are you trying to change how they are displayed?  If the answer is no, then just get rid of the format statements.

View solution in original post

6 REPLIES 6
Astounding
PROC Star

Months and years are numeric variables that don't need formats.

 

Are you trying to change how they are displayed?  If the answer is no, then just get rid of the format statements.

ybz12003
Rhodochrosite | Level 12

I paste the code below again.

 

Data residences;

infile "\\Pathway\ResidencesDates.csv" dlm="," dsd missover lrecl=32000 firstobs=2;

;

input

Id

ResStartMM_1

ResStartYY_1

ResStopMM_1

ResStopYY_1

;

Format ResStartMM_1 DateMM.;

Format ResStartYY_1 DateYY.;

Format ResStopMM_1 DateMM.;

Format ResStopYY_1 DateYY.;

Label ResStartMM_1="Residence Start Date Month";

Label ResStartYY_1="Residence Start Date Year";

Label ResStopMM_1="Residence Stop Date Month";

Label ResStopYY_1="Residence Stop Date Year";

RUN;

 

ybz12003
Rhodochrosite | Level 12

Below is my CSV file.  It's in the numbers was in general format in Excel.   I'm not sure if you could see that.

 

Id ResStartMM_1 ResStartYY_1 ResStopMM_1 ResStopYY_1
30005 2 1994 6 2001
Damo
SAS Employee

Hi @ybz12003

 

Those are not valid formats.

Try to use date9., etc. (cf https://support.sas.com/documentation/cdl/en/leforinforref/64790/HTML/default/viewer.htm#n16vcb736tg...)

 

Hope that helps.


Cheers,
Damien

ybz12003
Rhodochrosite | Level 12

Thank you all your prompt reply.  I got it fixed. 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 1575 views
  • 0 likes
  • 4 in conversation