data testing;
input Fiscal $ 1-16 Marca $ 17-36
AssetTypeSegment $ 37-60 Brand $ 61-73;
infile datalines expandtabs truncover firstobs=2;
datalines;
Fiscal Marca Segment Brand
ACCESORIOS ACCESORIOS Non-Automotive Not Defined
;
run;
For this record, I'm expecting Brand='Not Defined'
Your data elements don't start in the columns you think they do. You're just "lucky" that your strings are shorter than your field lengths so the issue only surfaces in the last column.
The bigger issue:
EXPANDTABS assumes Tab Stops every 8 characters. It doesn't look like that was the tab stop setting in the editor you've used.
Much more discussion and resolution options here.
If your data has tabs then reading with fixed columns is somewhat problematic and you are likely better off to use list input.
It can take a bit of practice to "count columns" correctly when the tabs have to be expanded logically.
Since the copy and paste from the forum to my editor is likely converting tabs to spaces then I cannot duplicate your result.
Your data elements don't start in the columns you think they do. You're just "lucky" that your strings are shorter than your field lengths so the issue only surfaces in the last column.
The bigger issue:
EXPANDTABS assumes Tab Stops every 8 characters. It doesn't look like that was the tab stop setting in the editor you've used.
Much more discussion and resolution options here.
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!
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.