If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Write to Operating system as a text file

Started by sgotike, 02 Feb 2009 09:43:21 AM

Previous topic - Next topic

sgotike

Hi there,

Not sure which forum to post this in.

Is it possible to write to the operating system from either Cognos package or report or query studio? I have this requirement where the user wants the information, say from a report, as a text file so that they can load it into their own tables or something.

Also, if the above is possible (writing a text file in OS) is it also possible to ftp the created file?
I am new to Cognos and was wondering if anybody had this kind of requiremnt and what kind of solutions they had.

I can create flat files from the database like Oracle or other, but I need to do this from Cognos.
Is it possible to do it from command line etc?

Any suggestions are greatly appreciated.

Thanks,
SG

vamsikrishna208

hey

i am not sure that...this will work...

its seems to me that u are talking abt reverse engg type...load the data from report in to DB TABLES...

such feature is not supported by cognos...


sgotike

What I meant to say was "we can generate a report  to pdf or excel format. Is there a way I can generate to a flat file. pure text file. I am not talking about loading into the database from the report.

The real question is: is there a way to communicate from Cognos with the command prompt...
For example, from within Cognos (say a report or package) can I write the output to a text file on say C:\temp.

m23

One of the format options for a report in Report Studio is Delimited Text (CSV). This is a pure text file with commas seperating the data values. Most databases would support the loading of CSV files.

You can run a report and save it wherever you want. Alternatively you can schedule a report and have it sent to an email address as an attachement. You might be able to do something with your mail server/email program to then automatically save/ftp the attachement to wherever you want it.

sgotike

Thank you for the info. Yes, I already use that option where you can schedule a report and e-mail it as an attachment.

What I am looking for is being able to do all that programatically. You can invoke the report studio from command prompt and run one. I am looking for that API reference where you can run Cognos (query or report or package etc) from the command prompt and do more with the generated text output. For example, from a shell script I want to run these and process the output and use the output to feed other applications or processes. I am looking for that command prompt reference, if there is one.

Tahnks again.

m23

I think it is possible to do what you are asking using the Cognos SDK. I have only ever done very basic things with it but if you have the SDK (it is a seperate license) and access to the cognos knowledge base search for document 1008399.6. This provides a java example of what you are asking for. The description is

Description:
This SDK Java sample will demonstrate how to execute a report and save the output to the Content Store. It will then query the Content Store and find all the saved output(s) and save each of them to the local file system.

sgotike

Thank you for the info.
If it is a separate license then it's not an option. Theis kind of request comes to me in rare cases so it's not worth the money. I will have to find a workaround.

Thanks again.