{
  "id": "1997-september-setting-the-data-free",
  "slug": "1997-september-setting-the-data-free",
  "url": "https://dwillis.github.io/uplink/article/1997-september-setting-the-data-free.html",
  "year": 1997,
  "month": "September",
  "monthNum": 9,
  "headline": "Setting the data free",
  "kicker": "Tech Tip",
  "author_name": "Andrew Lehren",
  "author_title": "NICAR",
  "affiliation": "NICAR",
  "summary": "This article explains how to use Windows NT 4.0's AT command scheduler to automate data processing tasks like running FoxPro during off-hours, allowing more time for analysis and reporting instead of routine processing work.",
  "keywords": [
    "automation",
    "scheduling",
    "FoxPro"
  ],
  "topics": [
    "Investigative Methods",
    "Technology",
    "Data & Databases"
  ],
  "technologies": [
    "Windows",
    "FoxPro"
  ],
  "full_text": "You're walking on a moonlit beach with a loved one. No, you're processing data. Wait a second - you can do both at the same time. Using Windows NT 4.0, there is a clunky little command to schedule jobs while you're away from the office. With some planning, you can spend less time at your desk processing data, leaving more time for analyzing and reporting. Setting up The command to run NT's schedule service is called AT. For the most part, Microsoft's documentation shows how you can use this to back up your computer. But you can use it to run, say, FoxPro, and then use a program to do your legwork. First, you need to get it to work properly with a Windows program. Go to Start Settings Control Panels Click on the Services icon (it's the one with a couple gears grinding away). You get a menu box. Scroll down to Schedule. Highlight it. Hit the Startup Button. Now make sure your settings say the Startup type is Auto- matic, it will log on as System Account, and check the box to Allow Service to Interact with Desktop. Hit OK. Now, to make sure NT knows quickly about your changes: with Schedule still highlighted, hit the Stop button, and then hit the Start button. Now NT will let you run a Windows program at will. Where you're AT Now we're ready to actually work with the command scheduler using AT. Go to Start Run and then type Command. You get a command line prompt, but don't get scared. The command line you' need is easy to type. Here is an example to just launch FoxPro: At 11:00/next:s \"c:\\fpw26\\foxprow\" This means at 11 a.m. on the upcoming Saturday, start up FoxPro. The program will startup FoxPro every Saturday if you change next:s to /every:s. If you get lost in the syntax, there are two ways to on-line help. Atthe command prompt, you can type at ?, or you can go to Start Help and search for AT. Doing the work Just starting a program when you're not in the office is pretty silly, and your co-workers will only wonder more about you. The trick is to get the program to actually do something. Here's how I got FoxPro to do something. It's a two-step process. In the following case, let's assume I've got raw data sitting in a folder called FBI. And let's assume I've written a FoxPro program to import the data into empty tables. Let's say the program is called fbi.prg. (You could add on to your programs to include cleanup tasks like date conversions and elimi- nating leading spaces in text columns). Go to a text editor and type: KEYCOMP = WINDOWS CATMAN=OFF COMMAND = do c:\\FBl\\fbi.prg Now save that in a file called bi.fpw. You've just created a FoxPro configuration file that, when called on, will automatically do your cleanup routine. Now go to a text editor again and type: c:\\fpw26\\foxprow-Cc:\\fbi\\fbi.fpw And save that in a file called fbi.bat. You've just created a batch file that will automatically launch FoxPro 2.6 and, by using -C, you've redirected FoxPro to look to your alternate config file. Don't worry about affecting future uses of FoxPro. The program will only go to that alter- nate config file when you tell it. The Last Part Now let's go back to the AT command. Go back to your prompt, like you did before. Type: at 11:00 /every:s \"c:\\fbi\\fbi.bat\" Now, every Saturday, FoxPro will automati- cally process your latest update of that database. If you want to check on any jobs, go to the prompt and type AT, then hit return. It will list all your jobs. Trouble Shooting What we'v done is tell our computer to start a program at a certain time, then look to that program's configuration file, which then tells it to process a certain database. Here are two problems I encountered along the way. First, make sure you're using the latest ver- sion of NT. Go to www.microsoft.com, click on support and go to Windows NT. Somewhere in that patch was the stuff that gets the Command Scheduler to actually work as well as promised. To make matters worse, the patch requires you to update your NT registry. To do this, look at the readme.txt file that comes with the patch. That, of course, refers to another part of the web site. For service patch 3, in section 3.6 of the readme file, it recommends going to www.microsoft.com/kb/. Then go to article Q166730 for Windows NT. Follow the six reso- lution steps. In addition, for those who got NT Resource Kit, you'll get a gui version of the Command Scheduler. That may make the AT command a little clearer. Andy Lehren can be reached at 1-800-NBC- NEWS x 7739, or by e-mail at andy@nicar.org",
  "provenance": {
    "extracted_by": "pre-v2",
    "extracted_at": "",
    "verified": true
  },
  "similar": [
    {
      "slug": "1997-may-cheating-at-foxpro",
      "score": 0.328
    },
    {
      "slug": "2004-november-automate-common-tasks-with-foxpro-programs",
      "score": 0.28
    },
    {
      "slug": "1997-november-poll-producer",
      "score": 0.25
    },
    {
      "slug": "1997-july-the-data-they-are-a-changin",
      "score": 0.217
    },
    {
      "slug": "1996-october-how-long-did-that-take",
      "score": 0.214
    }
  ],
  "html_url": "https://dwillis.github.io/uplink/article/1997-september-setting-the-data-free.html",
  "json_url": "https://dwillis.github.io/uplink/article/1997-september-setting-the-data-free.json"
}