You are trying to read all of the records from one CSV file by using a DO loop during one iteration of the DATA step.
But inside the DO loop you have coded subsetting IF statements that will cause the whole DATA step to re-start.
So once any of those subsetting IF statements are false you will stop processing the current CSV file and move onto the next one.
Hi TOM,
Thanks for your input.
But as mentioned above in that case it must read atleast one observation.
but its showing zero observation it seems its not getting inside of csv files.
Thanks
Aman4SAS, Tom is right
Showing the number of obs Observations is telling something on the output dataset.
When there is nothing to output it will tell you 0.... That doesn't say you anything on what has been readed/processed.
The best approach for debugging is eliminating parts of the code (eg %codelist) and see what is happening.
An other remark: There is no need for that step creating a dirlist, you could define the wildcarding immediate at the filepath statement
Hi Jaap,
I heartily agree that Tom Sir is right.
"those subsetting IF statements are false you will stop processing the current CSV file and move onto the next one"
at the time moving to next , it must left something behind.
what i can see, its reading all desired observation but its not putting on Created dataset.
The same program is running very fine for for txt files but its not working in my csv files. so i m confuse to remove my subset conditions,
As per using wildcard. Thanks for your valuable input. I have used that to resolved my problem for temp basis. and it works
Thanks
Aman4SAS, There was a time computer-resources where that expensive you did a lot of desktopwork (paper pencil) preventing mistakes as much as possible. The hollerith cards very patient doing some coding with that. At his era your time is much more valuable than the one of the machine. As long as your causing more trouble (losing data, changing/sending data) a try to verify some assumption is more effective.
Put a * (comment or remove) that %codelist (drop that card). Same for the other If _error_ if soc.
See what happen, will cost less than a few minutes.
When assumption is right you see obs>0 when still 0 there is something different.
As you say with txt-files it is working but with csv not. For me a csv-file is just a special text file where a special chosen character has the meaning of column delimiter.
You are possible confused with those suffixes of files, being believed having a special meaning. Do not be that easy in your believe.
Just at Windows this done with associations to find an associate program. It makes live easy that way. At Unix and Mainframe they are also existing but associations? no way.
You are liking probably zip-files. For fun docx xlsx egp pkg and much more are zip-files with a dedicated content for some programs
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.