Solved
New Contributor
Posts: 3

# Read European numeric data

Hi

I am new to SAS and trying to read a data set with European format.  Comma means the decimal point in this data set.  Single space is the delimiter. Each value represents one input variable.    I tried to use euro10. read the following data and got nothing.

Here is the example of my data set.

29,048 45,195 29,048 113,36 114,29 113,98 29,693 29,805 29,765 33,698 33,813 33,775 43,4 43,8 43,53 32,409 32,409 32,409 22,933 22,933 22,933 1,02 1,04 1,03 30,999 30,999 30,999 161,907 162,804 162,209 6,947 7,247 7,067 8,019 8,466 8,183 7,76 7,951 7,814 9,099 9,496 9,154

Any help is appreciated!

Thanks

Margaret

Accepted Solutions
Solution
‎06-19-2018 03:49 PM
Super User
Posts: 13,583

## Re: Read European numeric data

Posted in reply to Learningforfun

The COMMAX format will reverse the role of the comma and decimal point in numeric values.

```data example;
informat x commax10.3;
input x;
format x best10.;
datalines;
29,048
45,195
29,048
113,36
114,29
113,98
;
run;```

All Replies
Solution
‎06-19-2018 03:49 PM
Super User
Posts: 13,583

## Re: Read European numeric data

Posted in reply to Learningforfun

The COMMAX format will reverse the role of the comma and decimal point in numeric values.

```data example;
informat x commax10.3;
input x;
format x best10.;
datalines;
29,048
45,195
29,048
113,36
114,29
113,98
;
run;```
Super User
Posts: 10,280

## Re: Read European numeric data

Posted in reply to Learningforfun

Use the commax informat.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
New Contributor
Posts: 3

## Re: Read European numeric data

Posted in reply to KurtBremser

Kurt,

Thanks for the suggestion on commax10.3.  It worked.  Can you show me how to separate those values because each value represents one variable.  I tried to use dsd and truncover to separate these values, and didn't get anything.

29,048 45,195 29,048 113,36 114,29 113,98 29,693 29,805 29,765 33,698 33,813 33,775 43,4 43,8 43,53 32,409 32,409 32,409 22,933 22,933 22,933 1,02 1,04 1,03 30,999 30,999 30,999 161,907 162,804 162,209 6,947 7,247 7,067 8,019 8,466 8,183 7,76 7,951 7,814 9,099 9,496 9,154

Thanks

Margaret

Super User
Posts: 10,280

## Re: Read European numeric data

Posted in reply to Learningforfun

@Learningforfun wrote:

Kurt,

Thanks for the suggestion on commax10.3.  It worked.  Can you show me how to separate those values because each value represents one variable.  I tried to use dsd and truncover to separate these values, and didn't get anything.

29,048 45,195 29,048 113,36 114,29 113,98 29,693 29,805 29,765 33,698 33,813 33,775 43,4 43,8 43,53 32,409 32,409 32,409 22,933 22,933 22,933 1,02 1,04 1,03 30,999 30,999 30,999 161,907 162,804 162,209 6,947 7,247 7,067 8,019 8,466 8,183 7,76 7,951 7,814 9,099 9,496 9,154

Thanks

Margaret

For that I would need to see your code, and at least one line of the infile (post as attachment, or use the {i} button).

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
New Contributor
Posts: 3

## Re: Read European numeric data

Posted in reply to KurtBremser

Hi Kurt,

I tried to import the attached data by using the following code.  I was able to get Zeit (time), but not the remaining variables.

I appreciate your help.

Margaret

data testdata;
infile 'C:........' dsd;
informat zeit time8.2 a1-a60 commax10.3;
input zeit a1-a60;
format zeit time8.2 a1-a60 best10.;
run;

Super User
Posts: 10,280

## Re: Read European numeric data

Posted in reply to Learningforfun

`dlm=';'`

to your infile statement.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Super User
Posts: 13,583

## Re: Read European numeric data

Posted in reply to Learningforfun

@Learningforfun wrote:

Kurt,

Thanks for the suggestion on commax10.3.  It worked.  Can you show me how to separate those values because each value represents one variable.  I tried to use dsd and truncover to separate these values, and didn't get anything.

29,048 45,195 29,048 113,36 114,29 113,98 29,693 29,805 29,765 33,698 33,813 33,775 43,4 43,8 43,53 32,409 32,409 32,409 22,933 22,933 22,933 1,02 1,04 1,03 30,999 30,999 30,999 161,907 162,804 162,209 6,947 7,247 7,067 8,019 8,466 8,183 7,76 7,951 7,814 9,099 9,496 9,154

Thanks

Margaret

If you mean these are all supposed to be read into a single variable with each value a separate observation then this might get you started:

```data example;
informat x commax10.3;
input x @@;
datalines;
29,048 45,195 29,048 113,36 114,29 113,98 29,693 29,805 29,765 33,698 33,813 33,775 43,4 43,8 43,53 32,409 32,409 32,409 22,933 22,933 22,933 1,02 1,04 1,03 30,999 30,999 30,999 161,907 162,804 162,209 6,947 7,247
;
run;```

The @@ at the end of an input line means to stay on the same record until you reach the end of the data.

☑ This topic is solved.

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

Discussion stats
• 7 replies
• 108 views
• 0 likes
• 3 in conversation