Oct 022014

A new version of CSPro has been released, 6.0.1. This is a major release, as it also involves the release of the CSEntry Android app. Now data entry applications can be run on Windows, as before, but also on Android phones and tablets. For more information on this version, click on the CSPro 6.0.1 tag to read previous posts highlighting various new features.

Download the new version here, and as always, you can access older versions on the Software page.

New Tool: Record Cleaner

 Posted by  Tools  Comments Off
Sep 172014

Check out the tools page for a newly released tool. The Record Cleaner removes records of a type not listed in the dictionary and adds required records that are not present. This tool will prevent you from getting “Invalid Record type” or “Required Record or Group ______ not found” messages when you process your data. It will also give you a limited report showing you what records were inserted and deleted.

May 012014

Many features and language improvements have been added to CSPro for today’s May 1 beta release. As usual, we have also made minor improvements and fixed some bugs. If you experience any bugs while running your applications, in either the Android or Windows environment, please email cspro@lists.census.gov. Here is a summary of the features added since the March beta:

  • The .pen application file has been dramatically reduced in size, which makes deploying it to the Android device (and updating it) much quicker. This means that you must recreate all of your .pen files while testing this new version.
  • In the last beta release we added a new string type to the CSPro language. Now you can declare traditional alpha variables, as well as these new strings, locally. In the past this was only possible with numeric variables. So now you can write:

        alpha (50) localVariable = "This is a locally declared alpha variable.";


        string localVariable = "This is a locally declared string and is different from the above variable.";

  • Alpha and string objects can be concatenated using the + operator as an alternative to using the concat function. For example:
    string part1 = "Hello", part2 = ", ", part3 = "World!";
    errmsg("%s",part1 + part2 + part3); // displays: Hello, World!
  • The Android version now respects the upper case attribute. Cases are also marked as partially saved in the case listing. A search button has been added to the show / selcase graphical interface.
  • A new “tablet” mode exists on the desktop for CSEntry. With the PFF property FullScreen=NoMenus, not only will the case/file tree on the left be hidden (as occurs with FullScreen=Yes), but the menus and toolbars will also be hidden. This mode is ideal for conducting data entry on tablets.
  • A new tool, the PFF Editor, has been added to the suite of CSPro tools. This tool allows you to edit PFFs without needing a text editor. It can be useful as it displays all of the options available to an application developer for a given type of PFF.
  • Setvalueset, when provided with array parameters, has always been a way of creating dynamic value sets. Now you can pass one-based arrays to the function, in addition to the traditional zero-based arrays. If the zeroth element is blank, setvalueset will start processing at the first element of the array.
  • The accept function now accepts arrays as option parameters, which allows for more dynamic queries. For example:

    array string acceptOptions(20);

    // ...

    numeric ctr;

    do ctr = 1 while ctr <= count(NAME)
        acceptOptions(ctr) = "Interview " + NAME(ctr);

    acceptOptions(ctr) = "All Interviews are Complete";

    acceptOptions(ctr + 1) = ""; // mark the end of the array

    numeric selection = accept("Select an Option",acceptOptions);

    // ...

  • There is a new function, showarray, that is similar to the show function, except that instead of displaying items from rosters or records, it displays information located in an array. Here is an example of how it might be used:

    array string showValues(20,3);

    // ...

    numeric ctr;

    do ctr = 1 while ctr <= count(NAME)
        showValues(ctr,1) = NAME(ctr);
        showValues(ctr,2) = getlabel(SEX,SEX(ctr)); 
        showValues(ctr,3) = maketext("%d-years-old",datediff(AGE(ctr),sysdate("YYYYMMDD"),"y"));

    showValues(ctr,1) = ""; // mark the end of the array

    numeric selection = showarray(showValues,title("Name","Sex","Age"));

    // ...

  • A set of three new functions has been added: setvalue, getvalue, and getvaluealpha. They can be used as a way of assigning to and retrieving values from dictionary items by using the item name as an alpha field. For example:
    // instead of writing...
    SEX = 2;

    // you can write...

    Realistically you would not use the function if the variable name that you are assigning to is known. But, for example, if you want to add a button to your userbar that the interviewer can click on to assign missing values to various fields, you could write:

    function DoMissing()

    // ...

    userbar(add button,"Missing",DoMissing);

    Or for a more complicated example, here is code that could be used to write out customized .csv reports based on the parameters specified in an array. By adding, removing, or reordering the strings in the array, you would get a different report without having to touch any other code.


    array string PrintOptions(20) = "NAME","SEX","AGE";

    // ...

    numeric ctr,recCtr;

    for recCtr in PERSON_REC

        string output;
        do ctr = 1 while PrintOptions(ctr) <> ""
            if ctr > 1 then
                output = output + ",";

            if getvalue(PrintOptions(ctr)) <> default then // then the field is numeric
                output = output + maketext("%f",getvalue(PrintOptions(ctr)));
                output = output + strip(getvaluealpha(PrintOptions(ctr)));


Mar 272014

A few features have been added to the the March 26 beta release:

  • A string type has been added to the CSPro logic language. This is similar to the alpha type, except that it is of variable length, meaning that it can be used more simply than alpha variables. There is no longer a need to use the strip function on your strings for many operations. In the past you might write this:
    alpha (300) myFolderName,myFileName;

    Now you can simply write:

    string myFolderName,myFileName;
  • A case tree has been added to the Android version. You can bring this up by swiping from the left side of the screen to the center. It is further documented in the Android beta release notes. Note that if you have .pen files created with the old beta version, you will have to recreate them, as the structure of the file has changed.
  • The gps function now has an optional accuracy component. Instead of returning the first reading, you can specify that you want to wait for a reading of certain accuracy. For example:
    gps(read,300,10); // wait for up to 300 seconds for a gps reading of accuracy 10 meters or less
  • You can now define occurrence labels in the dictionary. For example, if you open the dictionary for the Metro Survey application, click on the Line Perceptions record, and select Edit -> Occurrence Labels, you will see the following dialog:

    You can define occurrence labels for multiply occurring records and multiply occurring items. When dragging these records/items to a form, you will be prompted in the Drag Options window if you want to use the occurrence labels instead of 1, 2, 3, … for the row labels. In addition, you can access these in logic using a new function, getocclabel. For example:

    errmsg("%s",getocclabel(LINE_PERCEPTIONS_REC(2))); // displays Green

    In your CAPI text, you can also refer to the current occurrence label. In the Metro Survey it is used as follows: Do you agree with the following statement: “The rail cars on the %getocclabel% line are generally clean.”

  • There are two new features in the Dictionary Macros. You can copy/paste item lengths now, in addition to names and labels. You can also bulk add items to records.
  • In addition to the above, we have fixed bugs and added some minor features and improved functionality.

Android Beta Released

 Posted by  Android  Comments Off
Feb 172014

The beta version of the CSEntry application for Android devices has been released. If you would like to test it, please visit the beta page. CSPro 6.0, along with this application, will be officially released in a few months.

Android Update

 Posted by  Android  Comments Off
Dec 172013

It has been a long time since anything has been posted here, but it is because we are busy working on the Android version of CSEntry. We have made good progress, and hopefully we can release an alpha version of this in a month or two. If you would like to be notified of the alpha release, please sign up on the beta software page.

The first release will be targeted mostly at phone users, as it will be one-question-per-screen. Later we will add support for multiple questions on a screen. As with the old Pocket PC version, you will design your application on the desktop and then deploy it to your Android device to run the program.

Sep 252013


ICF International uses CSPro for DHS processing.

Title: Data Processing Specialist – Demographic and Health Surveys Project
Location: Calverton / Rockville, MD

Job Description: ICF has an opening for a Data Processing Specialist with the Demographic and Health Surveys (DHS) project. The DHS project assists developing countries to implement household-based surveys in the areas of maternal and child health, family planning, HIV/AIDS, malaria, and nutrition. To date, we have completed more than 300 surveys in more than 90 countries in Asia, Africa, Latin America, and the former Soviet states.

Key Responsibilities:

  • Develop and maintain software systems for data entry, editing, imputation, and analysis for paper based population surveys in developing countries
  • Develop and support tablet and laptop based computer-aided interviewing systems in developing countries
  • Build capacity in implementing agencies worldwide via workshops and seminars on data use and survey processing
  • Produce data analysis to support country report production
  • Carry out data archiving and provide technical support for data users

For more information on the job, see the above link.

Aug 222013

Yesterday we released version 5.0.3 of CSPro. As with 5.0.2, there are only minor improvements in this version. We made some additional bug fixes that will allow CSPro to work on Windows 8 machines. CSPro still does not work on Windows RT tablets or Windows Phone devices.

The new version has a few new functions: dateadd, datevalid, onchangelanguage, seekmax, and seekmin.

Dateadd and datevalid were both requested by users, and seekmax and seekmin will be very useful for batch editing applications. Onchangelanguage can be used in CAPI applications.

A number pad control has also been added, which is useful for CAPI applications run on tablets.

Download the new version here, and as always, you can access older versions on the Software page.

On another note, view this forum posting for information about an online CSPro e-Learning course offered by the Statistical Services Centre at the University of Reading.

CSPro Training in October

 Posted by  Training  Comments Off
May 082013

The U.S. Census Bureau’s International Programs Center for Technical Assistance will conduct a CSPro workshop in Washington, DC from October 28 – November 8, 2013. This workshop, for beginning or intermediate users of CSPro, is entitled Data Processing Solutions Using CSPro. To learn more, view the workshop announcement.

The Census Bureau also offers workshops related to demographic and statistical issues. In September there will be a workshop about Gender Statistics for Data Users (September 3 – October 4, 2013). Later that month there will be an Introduction to Survey Sampling workshop (September 30 – October 11, 2013).

Operator Statistics Viewer

 Posted by  Tools  Comments Off
Apr 222013

There is a new tool for download on the Tools page. This program, the Operator Statistics Viewer, is written in C#, and as always, the source code is available upon request. The tool allows for easy analysis of one or more log files. Features include an option to associate names with operator IDs, the ability to set targets and view progress towards those targets, and many ways to visualize the data from operator logs in tabular and graph form. Some sample screenshots: