1) Use already set preferences file :
Use the suggested File to copy it into the local directory.
C:/....AppData\Roaming\SQL Developer\system4.1.3.20.78\o.sqldeveloper.12.2.0.20.78\product-preferences.xml
Copy this attached file and replace it in your user directory ( refer the above folder structure).
inside this xml file you can find the preferences called "Arul-SQL"
2) Otherwise, you can set this manually by the following way.
settings : After install the driver for db2
Go to tools
go to preferences
go to database
go to sql formatter
go to other vendors
select db2 formatter
choose profile( we can have different profiles for formatter) I have used with my name Arul
then click Edit