@DPorcelan
You've got already solutions how to dynamically generate the required Proc Datasets for changing the formats.
One thing to consider: IF you also plan at any stage to load data from SAS back to DB2 then the default formats applied when unloading are what you need when uploading. This is because SAS doesn't have a data type of Date so the formats are used by SAS to determine that it's dealing with a SAS Date or Datetime value. ...and I don't know why but this only works implicitly if you use the default formats (even though SAS should imho also recognize the other out-of-the-box formats - but it doesn't).
And unrelated to your question:
- You might want to have a look into the READBUFF option. The default value is often too low.
- I assume you've got the connect to statement in there. Ideally you have an authentication domain created in SAS metadata and don't use user and password. And you then write your connect statement directly in the code using the AUTHDOMAIN= option. If you want to stick with something in an external file then I personally prefer to not use an %include with a fully qualified pathname but to implement via an autocall macro - one of the default folders SAS searches for such macro code is under .../SASEnvironment/SASMacro (the search path is defined and extendable via option SASAUTOS).
%include "/sas/connect/&SSID.connect.sas";
... View more