I have a flat file to read in SAS with delimiter '¬'. Before reading in SAS, i want to check no of columns in each row using unix command however it gives incorrect result.
Command used - awk -F'¬' '{print NF}' in_file.txt | uniq
Please suggest.
@PRAVIN_JAIN wrote:
I have a flat file to read in SAS with delimiter '¬'. Before reading in SAS, i want to check no of columns in each row using unix command however it gives incorrect result.
Command used - awk -F'¬' '{print NF}' in_file.txt | uniq
Please suggest.
For Unix/Linux these things are really simple to Google. There is so much out there. Like here for example.
WHY do you want to do this? If it's just so that some lines have less columns (like when there is no data for the last few columns) then just use the truncover option in the infile statement and SAS will handle this nicely.
You could also use SAS for counting the characters. Just a SAS datastep with an infile and input statement and then the countc() function
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.