I try to eport csv files in a DI Studio job using the file writer transformation. So far, so good. But when I try to have labels as a header instead of the variable names via entering label as a infile statement of the meta data object of the file, he still uses variables instead of labels as headers.
Am I missing an option to get labels instead of variable names?
"I try to eport csv files in a DI Studio job using the file writer transformation."
What you describe and show us doesn't add up. The screenshot you're showing us is from the File Reader. This transformation is used to read an external file (i.e. a .csv) into SAS. The File Writer is used to write a table to an external file.
Can you please clarify what exactly you're trying to achieve?
If it is about writing a SAS table to an external file (a .csv) and you want to use the SAS variable labels and not the SAS column names as column headers in the .csv then you will have to use custom code (user written node or reusable as a custom transformation) and using macro %ds2csv sounds like a good option to do so.
Should this really be about reading an external file into a SAS table using the File Reader transformation:
There is no LABEL option for the INFILE statement. Using DIS the column names and attributes created are based on your table metadata definition. That's what DIS will be using to generate the SAS code. If you want different column names then just change them in the table metadata definition.
The screenshot is actually the metadata object of the csv file, not the File Reader. The File Writer does not offer any real Option I could identify using labels.
@Alkibiades wrote:
The screenshot is actually the metadata object of the csv file, not the File Reader.
The File Writer does not offer any real Option I could identify using labels.
True. And yes, the file writer doesn't provide such an option so you will have to do your own thing.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Early bird rate extended! Save $200 when you sign up by March 31.
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.