0% found this document useful (0 votes)
125 views6 pages

Cognos - Burst To File System With Post Processing ETL - Documentos de Google

This document describes a process to burst a report to a file system location and run a post processing ETL script on the output files. It involves: 1. Configuring Cognos to save report outputs to a file system. 2. Creating a file system location in Cognos Connection to store report outputs. 3. Creating an SSIS package to process the output files by deleting XML files and renaming files. 4. Creating a stored procedure to execute the SSIS package. 5. Creating a report to call the stored procedure and display the SSIS execution log. 6. Setting up a Cognos job to burst the report and then run the log report to

Uploaded by

Paula
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
125 views6 pages

Cognos - Burst To File System With Post Processing ETL - Documentos de Google

This document describes a process to burst a report to a file system location and run a post processing ETL script on the output files. It involves: 1. Configuring Cognos to save report outputs to a file system. 2. Creating a file system location in Cognos Connection to store report outputs. 3. Creating an SSIS package to process the output files by deleting XML files and renaming files. 4. Creating a stored procedure to execute the SSIS package. 5. Creating a report to call the stored procedure and display the SSIS execution log. 6. Setting up a Cognos job to burst the report and then run the log report to

Uploaded by

Paula
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

BursttoFileSystemwithPostProcessingscriptorETL

Thisexampleshowshowtobursttothefilesystem,andincludeapostprocessingETL.Itdoesnotusetheinbuilt
Cognospostprocessingscriptasweonlywantthescripttorunwhenthisonereportisbursttothefilesystem.
Challengesthatarehandledthiswayinclude:

Onlyrunpostprocessingscriptonasinglereportoutputtofilesystem,notallreports.
RenamingofPDFfiletoeliminatelanguagespecificationaddedbyCognos(enus).
Deletingthexmlfilethatisalsocreatedwhenburstingtothefilesystem.

Step1:ConfiguretheCognosinstance
InCognosConfigurationmakesuretheoptionforSavereportoutputstoafilesystem?issettotrue.Thiscanbe
foundunder[LocalConfiguration].[DataAccess].[ContentManger].

Next,underActionsmenu,chooseGlobalConfiguration.ThenontheGeneraltabsettheArchiveLocationFile
SystemRoot.Thiswillbetherootdirectorywhereyouwilllatercreatesubdirectoriestostorereportoutputs.You
cancreateasmanysubdirectoriesasyoulike,buttheywillallhavetobecontainedunderthisoneroot.Itshouldbe
createdasaURI.Thehelpdocumentsareprettyclearbuthereissyntax:
file://\\<server>\<fileshare
>.

YouwillneedtorestarttheCognosServicefortheconfigurationchangestotakeeffect.


Step2:CreateafilesystemlocationinCognosConnection
InCognosConnectiongotoLaunchthenCognosAdministration.GototheConfigurationtabandchoose
DispatchersandServices.ThenchoosetheiconforDefineFileSystemLocations.

ClickNew,andgivethefilesystemlocationaname.Also,makesurethatyourconfigurationofthefilesystemroot
locationtookeffect.IfthefilesystemrootlocationisnotfilledoutwiththelocationyoudefinedinCognos
Configuration,somethingdidnttake.IBMhasaKBarticleonthis,butIfoundthatsometimesitjusttakesacouple
triestomakeitwork.Itshouldlooksomethinglikethis:

Nowyoucandefinethesubdirectoryyouwanttostorethereportsto.Use\\inthebeginning.Idontknowwhy
youneedtouse\\,butthatswhatIdidtomakeitwork.Also,makesureyouhavecreatedthesubdirectoryinthe
filesystem.
Step3:CreateaSSISpackagethatwillprocesseachreportfilecreatedbyCognosduringthefilesystemburst
ThisexampleusesSSIS2005butcanprobablybeportedtootherETLtoolsorjustscriptedintoa.batfile.Imnot
goingtogointodetailsabouthowtocreatetheSSISpackage,butwillbrieflyexplainonewaytodeletethe.xmlfiles
Cognoscreatesaspartofwritingtothefilesystemandalsohowtorenamethefiletoeliminatetheenuslanguage
designationthatCognosaddstotheoutputfiles.
Todeletethexmlfilesstartbycreatingaforeachloop,toloopthrougheachXMLfileinthedirectorywhereCognos
outputthereports.Thenuseafilesystemdeletetasktodeletethefile.Makesuretodefinethesourceofthefile
systemtasktobeavariabledefinedbytheloop.

Toremovetheenuslanguagedesignationfromthereportoutput,againcreateaforeachloop.Butthistimeloop
overthereports,onlylookingforfilesthatarelike*enus*.PDF.Mightnotbepdf,thisdependsonhowyouhad
Cognosoutputthereports.Thendefineafilesystemtasktorenamethefiletoremovetheenus.


Onethingtonoteisthatyouwillnotbeabletorenameordeletefilesthatareopen,andlocked,byanotherprocess.
Thiscancreatechallenges.Therearelotsofwaystodealwiththis,butthebestisprobablytokickeveryoneoffthe
filesharebeforerunningtheseprocesses.
Step4:Createstoredproceduretokickoffscript
CreateastoredprocedurethattakesthefullpathoftheSSISpackageasaparameter.Thenusexp_cmdshelltorun
theDTEXEC.execommandlineSSISexecutable.ThiswillcausetheservertoruntheSSISpackage.Asanalternative
youcoulduseaSQLAgentjoband/orstoretheSSISpackageontheserver.
CREATE

P ROCEDURE
[dbo]
.
[ ExecuteSSIS]
packagepathparam.
notethatthereisabuginxm_cmdShellknownbyMSthatonlyallowsoneset
ofdouplequotes.Thismeanswecannotexecutepackagesstoredatpathsthat
includespacesinthepath.Youcanfinddocumentationonthisbugifyou
googleit.
@DtsxPath
v archar
(
2 000
)
AS
BEGIN
SET

N OCOUNT

O N

buildcommandlinestring.
DECLARE
@CmdString
v archar
(
2 500
)

SET
@CmdString
=

' "C:\ProgramFiles\MicrosoftSQLServer\90\DTS\Binn\DTEXEC.exe"
/FILE'

+
@DtsxPath

EXEC

x p_cmdshell

@ CmdString

END

Step5:Createareporttokickoffthestoredprocedure
ThisleveragesstoredprocedurequerysubjectsinFMtorunthesprocpassingtheparameter,whichisthefullpathto
theSSISpackage.Thesprocparameterwillbelistedasanargument.Inthevalueforthatargumentdefinea
parameterusingthe?param?syntax.


Oneinterestingthingtonoteisthatyoursprocquerysubjectreturnsonedataitemcalledoutput.InSQLServerthis
willreceivetheresultofthesproc,whichinourcasewillbetheSSISexecutionlog.Thisisreallycool,becauseyou
canhaveCognosstorethatresultorevenemailtoyou.

Step6:Createareporttoexecutethesprocanddisplaytheoutput
Inreportstudioauthorasimplelistreportthathasapromptpagewithatextboxpromptfortheparameterdefined
intheFMmodelsprocquerysubject.(?param?).
Theninthelist,displaytheoutputfieldfromtheFMsprocquerysubject.Iwouldformattoremoveanycellborders,
etc.

YoucannowtestthereporttomakesureitkicksofftheSSISpackageandthatthepackagedoessomething.When
yourunthereport,itwilloutputtheresultoftheSSISpackage.
Step4:Setyourjobtobursttothefilesystem
Imnotgoingtocoverbursting,butwillassumeyoualreadyhaveburstingsetupinareport.Createanewjobin
CognosConnectionthathastwostepsrunInsequence.Itsveryimportantthatyouruninsequencenotallatonce.
Firststepwillbetorunyourburstreport,outputtothefilesystem.Itshouldbesetupsomethinglikethis:


MakesuretoedittheoptionsonSavetothefilesystem,choosingthelocationthatyouwanttosavetowhichyou
definedinstep2ofthisdocument.

ThesecondstepwillbetorunthereportusedtoexecutethesprocwhichkicksofftheSSISpackage.Inthiscaseyou
willoverridethedefaultvalueontheprompts,passingthepathtotheSSISpackage.Youalsomustchoosehowyou
wantittooutputandtowhere.Inthiscase,IstoreditasaPDFtothecontentstore,butyoumightwanttohaveit
emailyouorsaveashtml.ThisoutputwillbetheexecutionlogoftheSSISpackage.

Yourjobshouldlooksomethinglikethis:

Atthispointyoushouldbeabletorunorschedulethejobanditwillexecutetheentireprocessofburstingthe
report,outputtothefilesystem,deletingthexmlfiles,renamingthereportfiles,andstoringtheSSISresultlog.

You might also like