Help using Base SAS procedures

input SAS date

Accepted Solution Solved
Reply
Contributor
Posts: 49
Accepted Solution

input SAS date

Hi all!!

I have a problem to make an infile of this csv file:

a     b          c                    d

1     asd      10/10/2000     adfg

2     abd      10/10/2000     vdfg

3     afd      10/10/2000      bdf

4     axd      10/10/2000     bfdg

It is ok, when I make the input until data sas(I would like to have data sas in number format without any character format), but after I have a problem to make an import of column d.

The final dataset, shows correctly the columns a,b,c but the columns d is completely missing.

what should I do? how do you make the input file?

Thanks!


Accepted Solutions
Solution
‎09-14-2014 04:17 PM
Valued Guide
Posts: 2,177

Re: input SAS date

From the code that was posted earlier...

data infile;

  length   a   8

                b   $4

               dt   8

              cd  $4;

  infile csv firstobs=2 delimiter=';' missover dsd;

  input a

            b $

            dt  ddmmyy10.

            cd  $;

run;

As well as removing that DSD option (but only when appropriate)

I would suggest inserting  : before the ddmmyy10. format.

this ensures the floating -type input continues through the date.

View solution in original post


All Replies
Valued Guide
Posts: 2,177

Re: input SAS date

What code have you tried?

Contributor
Posts: 49

Re: input SAS date

I have resolved the problem.

it was the dsd option.

it dosn't need.

Solution
‎09-14-2014 04:17 PM
Valued Guide
Posts: 2,177

Re: input SAS date

From the code that was posted earlier...

data infile;

  length   a   8

                b   $4

               dt   8

              cd  $4;

  infile csv firstobs=2 delimiter=';' missover dsd;

  input a

            b $

            dt  ddmmyy10.

            cd  $;

run;

As well as removing that DSD option (but only when appropriate)

I would suggest inserting  : before the ddmmyy10. format.

this ensures the floating -type input continues through the date.

Contributor
Posts: 49

Re: input SAS date

Hi Peter,

it work with : before the data.

Thank you.

🔒 This topic is solved and locked.

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

Discussion stats
  • 4 replies
  • 278 views
  • 0 likes
  • 2 in conversation