BookmarkSubscribeRSS Feed
individual
Calcite | Level 5

Hi,

I am trying to import a spss data set into sas, but it seems that I loose some content on the way, meaning that my 1100 - long string is truncated to just 225.

I know that it is possible to extent the lenght of the variables, but so far I was not able to understand how to do it.

The sintax that I have used is:

PROC IMPORT

  DATAFILE=''

  OUT=

  DBMS=SAV replace;

run;

RUN;

Thank you

3 REPLIES 3
SUDOKU
Fluorite | Level 6

Hi There:

Check out the LRECL system option at

SAS(R) 9.2 Language Reference: Dictionary, Fourth Edition


Syntax


LRECL=n | nK | nM | nG | nT | hexX | MIN | MAX 

Syntax Description

n
specifies the logical record length in multiples of 1 (bytes); 1,024 (kilobytes); 1,048,576 (megabytes); 1,073,741,824 (gigabytes); or 1,099,511,627,776 (terabytes). For example, a value of 32 specifies 32 bytes, and a value of 32k specifies 32,767 bytes.

ballardw
Super User

Another option if you have access to SPSS is to try exporting from SPSS to SAS. One additional advantage of this approach  is the option to create a SAS Format program file that will mimic SPSS value displays.

Reeza
Super User

Try DBMS=SPSS instead of SAV

PROC IMPORT

  DATAFILE=''

  OUT=

  DBMS=SPSS replace;

run;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 688 views
  • 0 likes
  • 4 in conversation