SAS instream upload with input statement: string truncation -


i wrote code snippet load data set in sas.

data eser7.ateneo; infile datalines missover; input fac $  aa0506  aa0607  aa0708;  datalines; architettura    200 200 200 economia    680 680 680 giurisprudenza  -   350 400 ingegneria  470 470 600 lettere -   -   150 smfn    -   -   180 scpolitiche -   300 300 ;  run;  proc print data = eser7.ateneo; run; 

in result viewer, noticed first variable fac has truncated string. can't solve setting fixed size fac column, best way adapt length dinamically?
thanks

sas columns have fixed sizes. need set longest possible size (through length statement, generally, or using informat on input) in order tell sas how space set aside column.

data eser7.ateneo; infile datalines missover; length fac $20; input fac $  aa0506  aa0607  aa0708;  datalines; architettura    200 200 200 economia    680 680 680 giurisprudenza  -   350 400 ingegneria  470 470 600 lettere -   -   150 smfn    -   -   180 scpolitiche -   300 300 ;  run;  proc print data = eser7.ateneo; run; 

what can if unable determine correct maximum size read in maximum possible size ($32767) , either use compression (options compress=yes; or options compress=char;) or post-input analyze dataset , modify length shorter size. cannot have per-row lengths; compression give close varchar functionality (but still needs maximum size set) @ cost of speed.


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -