(Data Flux | Data Management Studio 2.7)
I have a Macro Variable set to the input folder that contains 5 files .
I created a Fixed width input node and set the filename to the variable
I then export all the files contents to a pipe delimited file.
I have 2 dilemmas
1. Since this concatenates all the files into one export is there a way to concatenate the filename of each source to its record ?
2. I need the date that is also part of the name to be parsed out and added as another column
end result is a single file with FILENAME, FILEDATE columns added to each record from the original files
Hi
In the advanced properties of the Fixed Width Input node, you can enable the option "FILENAME_FIELD" by entering a variable name, which will output the name of the file read.
For extracting the date, would recommend to use an expression node with something like this:
Considering file name is similar to "MyFile_180827.txt", 'NAME' is the variable name for File Name.
string dateFile
parse(NAME,'_',null,dateFile)
dateFile = replace(dateFile,'.txt','')
vincent
Hi
In the advanced properties of the Fixed Width Input node, you can enable the option "FILENAME_FIELD" by entering a variable name, which will output the name of the file read.
For extracting the date, would recommend to use an expression node with something like this:
Considering file name is similar to "MyFile_180827.txt", 'NAME' is the variable name for File Name.
string dateFile
parse(NAME,'_',null,dateFile)
dateFile = replace(dateFile,'.txt','')
vincent
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.