0

I generate a table SAS

enter image description here

which contains the name of files in a PATH. In the next step I have to go through this table and use Proc import to import all these files checking a condition namely:

if  scan(f_name, 1, 'K')= looking_date_Num

where looking_date_Num is coming from another table enter image description here

How can I use a for loop applying the condition to upload all these DAT data?

Community
  • 1
  • 1
maniA
  • 1,437
  • 2
  • 21
  • 42
  • Write a macro to `proc import`, and then use one of the suggestions in the linked duplicate to call that macro. SAS has no "for loop", fyi, the similar loop in SAS is "do loop". – Joe Oct 06 '16 at 16:17
  • @Joe, where can I find this "duplicate"? – maniA Oct 06 '16 at 18:58
  • At the top of your question, there is now a box "This question already has an answer here:" and a link. Or, in the "Linked" box to the right. You also should've gotten a notification about this. – Joe Oct 06 '16 at 19:04
  • thanks, yes I got a notification but without link, I will try it thanks again! – maniA Oct 06 '16 at 19:08
  • Piece of advice, don't use proc import, write a data step since you have many files with what I assume is a consistent structure. You'll save yourself work down the road. – Reeza Oct 07 '16 at 00:54

0 Answers0