Help using Base SAS procedures

Any fast way to show the width of the variables in column format?

Accepted Solution Solved
Reply
Contributor
Posts: 53
Accepted Solution

Any fast way to show the width of the variables in column format?

I want to apply column input in DATA step. 

eg)  INPUT Name $ 1-7 ;

and I'm sick of counting letters and spaces to determine when column starts and finishes.

Is there a simple editor that shows 'rulers' at the top?


Accepted Solutions
Solution
‎12-14-2011 04:06 PM
Trusted Advisor
Posts: 1,301

Any fast way to show the width of the variables in column format?

A good external tool for windows is called V (http://fileviewer.com/).  It is not free, but's it's cheap and works well.

View solution in original post


All Replies
PROC Star
Posts: 7,480

Re: Any fast way to show the width of the variables in column format?

The list statement might provide what you are looking for.  E.g.:

data test;

  input;

  list;

  stop;

  cards;

1234567890abcdefgh

xxxxxxxxxxxxxxxxxx

;

will produce something like:

RULE:      ----+----1----+----2----+----3----+----4----+----5----+

15         1234567890abcdefgh

NOTE: The data set WORK.TEST has 0 observations and 0 variables.

Solution
‎12-14-2011 04:06 PM
Trusted Advisor
Posts: 1,301

Any fast way to show the width of the variables in column format?

A good external tool for windows is called V (http://fileviewer.com/).  It is not free, but's it's cheap and works well.

PROC Star
Posts: 7,480

Any fast way to show the width of the variables in column format?

And a cheaper way to do the same thing is to use Wordpad rather than Notepad and make courier or new courier the default font.  Wordpad has a built-in ruler.

Contributor
Posts: 53

Any fast way to show the width of the variables in column format?

V is pretty neat. Have to get that.

Super User
Posts: 3,256

Any fast way to show the width of the variables in column format?

If you have SAS/FSP licensed and are using SAS Display Manager then you can use the FSLIST procedure.

In the command window: FSLIST 'example.txt'. Once the FSLIST window comes up enter the command COLS ON to get a ruler.

Super User
Posts: 10,041

Any fast way to show the width of the variables in column format?

If you are using SAS/EG ,then at Import Wizard , you will see this ability.

Ksharp

🔒 This topic is solved and locked.

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

Discussion stats
  • 6 replies
  • 123 views
  • 6 likes
  • 5 in conversation