Help using Base SAS procedures

Read German date format in data step

Accepted Solution Solved
Reply
Contributor
Posts: 50
Accepted Solution

Read German date format in data step

Hi,

I m trying to do this:

 

data temp;
infile datalines;
input datum :  DATE10.
      value1 COMMAX12.2
      value2 COMMAX12.2
      value3 COMMAX12.2
      value4 COMMAX12.2;
datalines;
01.11.2017	366.020,57	273.972,60	83942020,57	83,94	

;
run;

But I am not able to read the correct date.

 

Can someone help me out please?

 

Thanks!

Dirk


Accepted Solutions
Solution
‎11-16-2017 08:44 AM
PROC Star
Posts: 1,283

Re: Read German date format in data step

ddmmyy10. format will do the trick

 

data temp;
input datum:ddmmyy10.;
format datum ddmmyy10.;
datalines;
01.11.2017
;

View solution in original post


All Replies
SAS Super FREQ
Posts: 9,371

Re: Read German date format in data step

Hi:
Suggest you look up INFORMATS for dates. The form that your date is in does not appear to fall into the DATE normal representation. You might need to switch to a different date informat. Also, you need the colon modifier for ALL of your VALUE variables, too (not just the DATUM variable). Anything you read with an informat should use the : modifier.

cynthia
Solution
‎11-16-2017 08:44 AM
PROC Star
Posts: 1,283

Re: Read German date format in data step

ddmmyy10. format will do the trick

 

data temp;
input datum:ddmmyy10.;
format datum ddmmyy10.;
datalines;
01.11.2017
;
Contributor
Posts: 50

Re: Read German date format in data step

Thanks a lot!
PROC Star
Posts: 1,283

Re: Read German date format in data step

Anytime, glad to help Smiley Happy

Super User
Posts: 10,280

Re: Read German date format in data step

To make the displayed format look exactly like the input, use the format

ddmmyyp10.

to replace the slashes with dots.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
☑ This topic is solved.

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

Discussion stats
  • 5 replies
  • 358 views
  • 3 likes
  • 4 in conversation