Thank you Vincent. I typed ed right after I entered sqlcmd, and got nothing. Now if I type any statement and then type ed notepad popped up with statement.
I liked the articale very much. However, ed through command line does nothing. I changed SQLCMDEDITOR to "notepad.exe" it didn't work as well. Any clue. Thanks.
I couldn't use linked server for DB2/400. Only possibility is OPENSOURCE. However, OPENSOURCE is not returning all records for any given query. I didn't fined any answer for this issue.