ADR Capture for Cognos

Creation date: 11/14/2018 4:41 PM    Updated: 6/5/2020 11:29 AM
common/scripts has a programs for reference: adrcaptureTest

Below is just a partial file found in /opt/carsi/src/common/adrcapture/main.ec.  Under the 'initialize program arguments' details how the office added by is used as a filter as to who will have an adrcapture_rec created.  You can also execute 'adrcapture -' from the shell to see other parameters.

Below are some shell command examples of running adrcapture for one ID number for the DEV office:

% adrcapture -r ADVNORML -o DEV -i 680734 -e -d

% adrcapture -r ADVNORML -o DEV -i 680758 -e -d

% adrcapture -r ADVNORML -o DEV -i 327027 -e -d


Below is a normal email from above program:




Program completed successfully.





$include sqldec.h;

#include "dec.h"

 

/* -----

               ADR Capture Program - For gathering adr information and storing

               it in adrcapture_rec.

----- */

main(argc, argv)

  int argc;

  char *argv[];

  {

  /* Initialize various variables. */

  int errors = status = 0;

  strcpy(mesgbuff, "");

 

  esql_init();

 

 

  if (adrcapture_open()) goto Finish;

 

  /* -----

                   Initialize the program arguments.

 

  if ((status = delete_recs())) goto Finish;

 

  if (! strcmp("DEV ", pofc)) load_donors(&id_dmm);

  else if (! strcmp("REG ", pofc)) load_students(&id_dmm);

  else if (! strcmp("ADMS", pofc)) load_apps(&id_dmm);

  else if (! strcmp("BUR ", pofc)) load_stubill(&id_dmm);

  else {

    sprintf(mesgbuff,"\nOffice %s cannot be processed at this time.\n", pofc);

    msg_add(MAIL_ERROR, mesgbuff);

    if (! send_email)   fprintf(fileptr, "%s", mesgbuff);

    goto Finish;

    }



In common/scripts there is a file called add_best_adr.  I made changes to this file and scheduled it to run Mon-Friday night.


src/common/adrcapture has code for selection process.