Page 1 of 1

DSJOBS - Command Line

Posted: Wed Jun 01, 2011 10:54 am
by Raftsman
When issuing the following command in administrator;

SELECT NAME FROM DS_JOBS WHERE CATEGORY = '\Jobs\EDW\ICMS'

I would like to write the results into a file for future reference. Is there a way.


Thanks in advance

Posted: Wed Jun 01, 2011 11:29 am
by dspxguy
You need to set COMO on in administrator

In Admin command line:

COMO ON filename

Then execute your query and output will be written to file in Projects/ProjectName/'&COMO&'/ path

Dont forget to turn off COMO.

COMO OFF

Thanks

Posted: Wed Jun 01, 2011 11:42 am
by Raftsman
The output column seems to be fixed. The output is wrapped. How do I expand the column length?

Thanks

Posted: Wed Jun 01, 2011 12:58 pm
by chulett
Add FMT 'xxL' after the column name, replacing xx with the output size you want to use. So, for example to make it a 30 character string, use SELECT NAME FMT '30L' FROM etc.

Posted: Wed Jun 01, 2011 5:43 pm
by ray.wurlod
You can use standard redirection operator. For example:

Code: Select all

cd $ProjectDir
$DSHOME/bin/dssh "SELECT NAME FMT '60L' FROM DS_JOBS WHERE CATEGORY = '\Jobs\EDW\ICMS';" > filepath