BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
hhchenfx
Barite | Level 11

Hi Everyone,

My "want" data has only 1 CELL (1 column and 1 row).

The data in this row is long (about 5000 letter, with all kind of character.)

I use SAS-Studio.

Can you please help me with that?

 

Thank you,

 

HHC

 

The sample value is:

<"ozexoz ;"=;-9: []/'\":+!@#$%& -0*&^%  nzzozOZypA5ozzznmUnzzozOZypA5><W15ySpnsrCW1sA5ZZ0</W1:SurvA5ySpnsrCW1sA5ZZD><W1:RA5prozzznmUnzzozMA5ozW1dW1ozW1><W1:MA5oZozA5m></W1:MA5ozW1DW1ozW1Mrup><W1:MA5ozW1DW1ozW1Mrup MA5ozW1DW1ozW1MrupNW1mA5="A5CW1SA5_CS_MW1"><W1:DW1ozW1ZZ A5lA5mA5nozNW1mA5="WRKLW1D_OZYPA5_CDA5"></W1:DW1ozW1ZZoA5m><W1:DW1ozW1ZZozA5m A5lA5mA5nozNW1mA5="WRKLW1D_P_OZYPA5_CDA5"></1:DW1ozW1ZZozA5m></W1:MA5ozW1DW1ozW1Mrup></W1:RA5prozzznmUnzzozMA5ozW1dW1ozW1><WMW1zzlzznmW1ddrAW1ddr1>20OZ 11W1</W1:W1ddr1><W1:W1ddr3>NW1RRW1MW1NSA5OZOZ, RZZ -</W1:W1ddr3>

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

What do you mean by IMPORT?

 

If you have a text file just read it.

data want;
  infile 'myfile.txt' truncover;
  input myvar $5000.;
run;

Note that there is a 32K limit on the size of a variable.

View solution in original post

3 REPLIES 3
Tom
Super User Tom
Super User

What do you mean by IMPORT?

 

If you have a text file just read it.

data want;
  infile 'myfile.txt' truncover;
  input myvar $5000.;
run;

Note that there is a 32K limit on the size of a variable.

hhchenfx
Barite | Level 11

Hi Tom,

 

I meant create a data using

 

data want;
input var $ ;

datalines;

 

 

 

 

Tom
Super User Tom
Super User

@hhchenfx wrote:

Hi Tom,

 

I meant create a data using

 

data want;
input var $ ;

datalines;

 


It is probably a lot easier if you just use an assignment statement.

data want;
  length var $5000 ;
  var =
  '<"ozexoz ;"=;-9: []/''\":+!@#$%& -0*&^%  nzzozOZypA5ozzznmUnzzozOZypA5>'
||'<W15ySpnsrCW1sA5ZZ0</W1:SurvA5ySpnsrCW1sA5ZZD>'
||'<W1:RA5prozzznmUnzzozMA5ozW1dW1ozW1>'
||'<W1:MA5oZozA5m>'
||'</W1:MA5ozW1DW1ozW1Mrup>'
||'<W1:MA5ozW1DW1ozW1Mrup MA5ozW1DW1ozW1MrupNW1mA5="A5CW1SA5_CS_MW1">'
||'<W1:DW1ozW1ZZ A5lA5mA5nozNW1mA5="WRKLW1D_OZYPA5_CDA5">'
||'</W1:DW1ozW1ZZoA5m>'
||'<W1:DW1ozW1ZZozA5m A5lA5mA5nozNW1mA5="WRKLW1D_P_OZYPA5_CDA5">'
||'</1:DW1ozW1ZZozA5m>'
||'</W1:MA5ozW1DW1ozW1Mrup>'
||'</W1:RA5prozzznmUnzzozMA5ozW1dW1ozW1>'
||'<WMW1zzlzznmW1ddrAW1ddr1>20OZ 11W1</W1:W1ddr1>'
||'<W1:W1ddr3>NW1RRW1MW1NSA5OZOZ, RZZ -</W1:W1ddr3>'
;
run;

Make sure to double any actual single quotes inside the strings that are quoted with quotes.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 612 views
  • 0 likes
  • 2 in conversation