How to automate and import files that are located in date sequential folders into SAS?

后端 未结 1 1303
我寻月下人不归
我寻月下人不归 2021-01-25 05:04

I currently have 700 folders that are all sequentially named.

The naming convention of the folders are as follows:-

2011-08-15_2011-08-15    
2011-08-16         


        
相关标签:
1条回答
  • 2021-01-25 06:07

    You should be able to wildcard the folders/files into a single fileref, e.g.

    filename allfiles "c:\SAS_data\extract\*\*.txt" ;
    
    data alldata ;
      length fn _fn $256. ;
      infile allfiles lrecl=256 truncover filename=_fn ;
      fn = _fn ; /* Store the filename */
      input ;
      put _INFILE_ ;
    run ;
    
    

    The wildcard folder & file works in SAS Unix, not sure about SAS PC.

    0 讨论(0)
提交回复
热议问题