Help using Base SAS procedures

Defining the format

Accepted Solution Solved
Reply
Contributor
Posts: 65
Accepted Solution

Defining the format

Hello everyone;

I tried to import a dataset and set the guessing row equal to 20,000. However, formats of the variables are nor what they should be. So I need to define formats of the variables. The following in my primary code.

proc import datafile="F:\Address of the file.txt"

            dbms=dlm

            out=test

            replace;

     delimiter='|';

     getnames=yes;

  Guessingrows=20000;

run;

I used the following code to define variable's format, but it didn't work.

proc import datafile="E:\Mobina\wo23370_LSU\Deposits\depositRateData_1998_03.txt"

            dbms=dlm

            out=depositRateData_1998_03

            replace;

format rate 5.3;

format apy 5.3;

format datesurveyed yyyymmdd10.;

format comment $30;

     delimiter='|';

     getnames=yes;

run;

I appreciate any suggestion.


Accepted Solutions
Solution
‎01-29-2015 08:17 PM
Super User
Posts: 19,822

Re: Defining the format

You need to write a data step to import the file instead.

Your proc import will create the code in the log.  Copy and paste that from the log into the editor and edit it as needed.

View solution in original post


All Replies
Solution
‎01-29-2015 08:17 PM
Super User
Posts: 19,822

Re: Defining the format

You need to write a data step to import the file instead.

Your proc import will create the code in the log.  Copy and paste that from the log into the editor and edit it as needed.

🔒 This topic is solved and locked.

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

Discussion stats
  • 1 reply
  • 157 views
  • 0 likes
  • 2 in conversation