Yes, you can use atomic compound statements on the command line:
Code:
$ db2 "create table t ( a int )"
DB20000I The SQL command completed successfully.
$ db2 "begin atomic declare i int default 0; while ( i < 10 ) do insert into t values ( i ); set i = i + 1; end while; end"
DB20000I The SQL command completed successfully.
364 local:~/ $ db2 "select * from t"
A
-----------
0
1
2
3
4
5
6
7
8
9
10 record(s) selected.
You may want to have a look at the SQL statements that you can place into such a compound statement.