Follow @dporton

JustCode : Delete cases from the output file of a dms script

This script shows you how to delete a case in the OnNextCase Event in the output data file.

' ****************************************
' Designed by : Smarter Dimensions
' Last Updated : 4th August 2009
' Delete cases from the output file of a dms script.
' ****************************************
InputDatasource(Input, "")
    ConnectionString = "Provider=mrOleDB.Provider.2; _
        Data Source=mrDataFileDsc; _
        Location=C:tempshort_drinks.ddf; _
        Initial Catalog=C:\temp\short_drinks.mdd"
    SelectQuery = "SELECT * FROM VDATA"
End InputDatasource

OutputDatasource(Output, "")
    ConnectionString = "Provider=mrOleDB.Provider.2; _
        Data Source=mrSAVDsc; _
        Location=C:\temp\Output.sav; _
        MR Init MDM DataSource Use=2; _
        MR Init Overwrite=1"
       MetaDataOutputName = "C:\temp\Output.MDD"
End OutputDatasource

Logging(MyLog, "")
    Group = "DMA"
    Alias = "datamgmt"
    FileSize = 500
    Path = "c:\temp"
End Logging

Event(OnNextCase, "")

    If Respondent.Serial > 10 Then
        dmgrLog.LogError_2(Ctext(Respondent.Serial) + " - Case Deleted")
    End If

End Event

Convert a DDF File to a Excel File.

We noticed that someone recently ran a search on our blog to try and find out how to convert a DDF to excel. This is a simple thing to do and to be honest there will be lots of examples in the DDL. Just install the DDL and then check the following directory out,

“C:\Program Files\IBM\SPSS\DataCollection\7\DDL\Scripts\Data Management”.

If you don’t have the DDL installed then read on.

Read more

De-dupe your data files

In this article I will show you one way that you could use to de-dupe your data collection datafiles. I am not sure how you would get duplicates in it in the first place , but let’s just assume you do have them. This example will use the Museum.ddf file in the DDL. This file & the ddf can be found here “.DDLDataData Collection File”

Read more

Printing respondent answers from a Data Management Script

It’s been a while since our last article on printing to word, but we thought that we should continue as we have completed some more work on this. In this article you will see how to take the code that has already been written and use it inside of a DMS script to produce a word document for every record.

Read more

How many concurrents : Part 2

In this article we are going to create the final DMS script that we use to recode the concurrents.csv file created in the previous article into something that is richer and usable for tabulation. The final output file will  be in a DataCollection Data file ( ddf ) format. This article assumes that you have some basic knowledge of DMS and VBA scripting.

Read more

How many concurrents : Part 1

Ever wanted to know what has been going on with your DataCollection Server Web concurrents? Interested in finding out if you are going over your limit of allowable concurrents frequently? If the answer to these questions is yes , then this set of articles is for you. In it we will show you how to look at the log files produced on your servers and calculate what has been going on and when. It should be noted that this article assumes that you have some knowledge of Data Management scripts as well as Tables scripts and VBA.

Read more

Clean a specified Context of HTML

Ever wanted to get rid of the html from a specific context? Have you needed to create a clean MDD and get rid of the annoying characters that are messing up your Reports for survey tables? If the answer is yes to either one or both of these questions then you should read this article. In it we explain how to open up your MDD  file in your dms script and clean the metadata of all those unwanted characters before you export the data.

Read more

%d bloggers like this: