*(Q) Is it possible to write with syntax an elaborate title in CROSSTAB command. * When I generate multiples crosstabs weekly, I dont want rewrite the titles each time. *(A) I've written a script and a macro to get custom titles in the output. * The script is named 'title.sbs' and the macro 'title.sps'. Both should * be stored in the same directory (). You get your custom title * using the following syntax: include '\title.sps'. CROSSTABS something BY somethingelse. settitle This is a custom title. dotitle. CROSSTABS blabla1 BY blabla2. settitle This is another custom title. dotitle. First the script (store it as \title.sbs): ============================================================== Sub Main() Dim objOutputDoc As ISpssOutputDoc Dim objItems As ISpssItems Dim objItem As ISpssItem Dim myindex As Long Dim lab As String Dim objSPSSText As ISpssrtf Dim mytitle As String Set objOutputDoc = objSpssApp.GetDesignatedOutputDoc Set objItems = objOutputDoc.Items() myindex=objItems.Count Set objItem = objItems.GetItem(myindex-1) Set objSPSSText =objItem.ActivateText mytitle=objSPSSText.Text objItem.Deactivate Do myindex=myindex-1 Set objItem = objItems.GetItem(myindex) lab=objitem.Label Loop Until lab="Title" objitem.label=mytitle Set objSPSSText =objItem.ActivateText objSPSSText.Text=mytitle objItem.Deactivate objItem.Selected=False Set objItem = objItems.GetItem(objItems.Count-1) objitem.Selected=True objOutputDoc.Remove End Sub ============================================================== And the macro (\title.sps): ============================================================== define settitle (!POSITIONAL !CMDEND). do if $CASENUM EQ 1. print /!quote(!1). end if. execute. !ENDDEFINE. define dotitle(). script '\title.sbs' . !ENDDEFINE. ============================================================== Hope this helps. Oliver Loch ---------------------------------------------------------------------------- Dipl. Stat. Oliver Loch German AIDS Study Group Phone: +49 89 5160 3457 Med. Poliklinik der LMU Fax: +49 89 5160 3593 Pettenkoferstr. 8a e-mail: loch@pk-i.med.uni-muenchen.de D-80336 Muenchen ----------------------------------------------------------------------------