After I post a support call to cognos I have a solution to pass a comma (,) or a pipe (|) in a string parameter.
For interest, show the solution and an example.
----
For some users, it is common practice to run macros to pass prompt values to Cognos Impromptu that contain commas. In this case, you need to place an escape character in front of the comma so that the full prompt value will be passed to Impromptu and not just the value up to the comma.
In the Impromptu.ini file, currently located in the Cognos\Cer3\Bin directory, the following entry is required (the escape character can be any character, not just the ampersand that is shown):
If you do not place the escape character in the Impromptu.ini file, the value being passed to the report via the prompt will be truncated at the comma.
[Startup Options]
Separator Escape Character=&
The macro syntax will be as follows:
Sub Main
'Declare the variables
Dim ImpromptuApp As Object
Dim ImpromptuReport As Object
Dim Order as Integer
Dim Status as String
'Create the Impromptu object and set it to visible.
Set ImpromptuApp = CreateObject ("Impromptu.Application"
ImpromptuApp.Visible 1
'Open the catalog
ImpromptuApp.OpenCatalog "D:\Macro\Macro.cat"
Order = 1
Status = "C&, Status"
'This line will pass the following to Impromptu. 'C, Status' , without the escape character the following would be passed to Impromptu 'C'
Set ImpromptuReport = ImpromptuApp.OpenReport("D:\Macro\Macro.imr",Order & "|" & Status)
ImpromptuApp.Quit
Set ImpromptuReport = Nothing
Set ImpromptuApp = Nothing
End Sub