In order to send a file to a vendor, I need to write the output from a view (or a query) in snowflake to a TXT file in a specific format like the one below (currently in SAS). I have tried exporting it a TSV file but does not work. The TXT file is too big to manually change anything on it. Has anyone tried this in the past and what are the workarounds for it?
put (ACCT_NUM)(10. -r) @12(ID) (z12. -r) (Amount) (9.2 -r)@33(First_Name) ($char32. -l) @65(Last_Name) ($char32. -l)@97(First_Name_1) ($char32. -l) @129(Last_Name_1) ($char32. -l) (Address_1) ($char38. -l)(Insert_spaces) ($char4. -l); putnames= no; run;
Sounds like you need to make a text file with the data in fixed positions.
If you cannot find a method in SNOWFLAKE to make such a file just build the line as a character variable and then write that one variable to the file. It will not matter whether you tell it to use comma or tab as the delimiter since it will be writing only one variables.