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

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
Rhodochrosite | Level 12

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.