hello,
I have learnt about TRUNCOVER option and worked with the below code without providing the option in INFILE statement
data sample;
length no $5.;
input no $;
datalines;
1
22
333
4444
55555
;
run;
i am expecting data like below for the variable "No" as i have not provided TRUNCOVER option in INFILE satatement
22
4444
55555
But to my surprise i am seeing data like this
1
22
333
4444
55555
I am not sure how this is working without providing TRUNCOVER option in the code
Please help me in understanding this
Truncover is not used anywhere in your post??
This code:
data sample; length no $5.; input no $; datalines; 1 22 333 4444 55555 ; run;
Is basically saying, read a string from the datalines up until the first space (unless you change the delimiter) and put that in no before moving the pointer on. As there is one string per line you get one per output observations. Exactly as you have coded it, no truncover used anywhere?
Maybe this paper will help you:
One aspect of datalines is automatic padding to 80 characters. Any line in a datalines block that has less than 80 characters is automatically extended. So truncover is only needed with datalines if you want to read more than 80 characters, or you work with delimited data and have possible empty fields at the end of a line.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.