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



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

Main Menu

CognosScript - bypass picklist file prompt

Started by JCarter, 20 May 2022 10:20:44 AM

Previous topic - Next topic


Hi all, any CognosScript experts out there?

We're trying to help our users migrate off of Impromptu, so we have a script and macro to inventory their IMR files and use runmac32 to save the SQL output.
Everything is working great, except for IMR files that reference a picklist file.

We want absolutely no user interactivity, so trying to get rid of all UI prompts. Any thoughts on how to bypass that prompt or point it to another picklist file that we specify? We don't care about the picklist file itself, just the SQL from the IMR.

CognosScript so far:
Sub Main

   Dim objImpApp As Object
   Dim objImpRep As Object
   Dim strSQLFileName As String
   Dim strImpCatalogName As String
   Dim strImpReportName As String
   Dim ReportPrompt As Variant
   Dim strReportNameArg As String

On Error Resume Next

'Local Username
   user = Environ("username")

'Full Name & Directory for Catalog and Report   
   strImpCatalogName = Environ("ImpromptuInfoCAT")
   strImpReportName = Environ("ImpromptuInfoIMR")

'Supplies Null prompt values for up to 20 prompts
   ReportPrompt = "|" + "|" + "|" + "|" + "|" + "|" + "|" + "|" + "|" + "|" + "|" + "|" + "|" + "|" + "|" + "|" + "|" + "|" + "|" + "|"

'Opens Impromptu, Enters catalog (no database connection), Opens Report, Enters blank prompts, Exports to SQL, Closes Impromptu
   Set objImpApp = CreateObject("CognosImpromptu.Application")
   objImpApp.OpenCatalog strImpCatalogName,"User",,,,false
   Set objImpRep = objImpApp.OpenReport(strImpReportName, ReportPrompt)
   strSQLFileName = Left$(objImpRep.FullName, Len(objImpRep.FullName) - 4)
   objImpApp.Visible False
   Set objImpRep = objImpApp.ActiveDocument
   objImpRep.ExportSQL strSQLFileName & ".sql"
   Set objImpRep = Nothing
   Set objImpApp = Nothing
End Sub

Thanks for anything that might help!