home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / qdrsum.zip / QDRSUM.DOC < prev    next >
Text File  |  1987-11-28  |  36KB  |  768 lines

  1.        The Quick and Dirty Report/Summary Utility for PC-FILE+ Databases        
  2.                              (QDRSUM, Version 3.0)                              
  3.  
  4.      QDRSUM performs two functions:  1) detail reporting and 2) summary report- 
  5. ing.    Either or both functions may be requested.   If a detail report is cho- 
  6. sen, summary statistics are only compiled for up to two fields, the primary and 
  7. secondary keys.  Otherwise, statistics are generated for all specified fields.
  8.  
  9.      The  detail  report  mode is chosen by specifying the /D (details) option. 
  10. QDRSUM can create up to a two-tiered report for a PC-FILE+ database,  using the 
  11. first two fields named as the primary and secondary keys,  and other fields for 
  12. the report's detail lines.   Whether to have keys (and tiering) is selected  by 
  13. the /1[s] and /2[s] options.   Adding the "s" after the /1 or /2 causes summary 
  14. subtotals to be included in the report.
  15.  
  16.      The output has a new page for each change in the primary key,  unless  the 
  17. /R  option  is  specified,   and a new heading for each change in the secondary 
  18. key.   All other fields have their values printed as detail lines  beneath  any 
  19. heading lines for each selected record in the data base.   Blank lines from the 
  20. detail fields are not printed.  Options can be used to control indentation, and 
  21. to print new lines as needed within the detail area.
  22.  
  23.      A title is specified by the /T option, and is printed with any primary key 
  24. details or on a separate line if the /N option is used.   Field headings may be 
  25. printed at the top of each page, by use of the /H option.   If headings are not 
  26. used,  detail information from fields can have trailing blanks removed,  by use 
  27. of the /B option.
  28.  
  29.      The  file  SELECT.DOC tells how to select the records for the report,  and 
  30. CATEGORY.DOC explains the special treatment of a field named  CATEGORY#.    The 
  31. option /C turns off CATEGORY# translation.   Fields with tilde (~) will usually 
  32. be printed with that part following the tilde first,  unless the /~  option  is 
  33. given.
  34.  
  35.      Call QDRSUM with no arguments to get a usage display screen.  Call it with 
  36. a question mark (?) to get full help screens.   If no fields are given  on  the 
  37. call line,  QDRSUM shows the database structure,  detailing field names,  their 
  38. sizes,  the primary sort key for the index,  if sorting has been done,  and the 
  39. approximate number of records in the database.
  40.  
  41.      QDRSUM  examines  the device characteristics of the standard output device 
  42. and determines whether it is the console (screen) or some other device.   If it 
  43. is  the console,  the user is prompted at each "page" break.   The /P overrides 
  44. this,  eliminating prompts and adding a formfeed.   Use of the /F option avoids 
  45. the formfeed.  For all other devices,  the page length is changed to 63 charac- 
  46. ters,  no prompts are used,  and formfeeds are printed at each page break.   If 
  47. the  page length is set to 0,  page breaks will not be noted,  and title breaks 
  48. occur only when a primary or secondary key changes.   (If this is confusing  to 
  49. you, imagine how it is to the program!)
  50.  
  51.      The next page shows the command line usage details.   The letter n is used 
  52. to indicate a decimal number is expected.   Note that all options must be sepa- 
  53. rated  from  other arguments,  including other options,  by at least one space. 
  54. Wherever a quoted string is shown,  spaces may  appear  between  the  quotation 
  55. marks.  The square brackets indicate optional parameters.
  56.  
  57.  QDRSUM                                                                 Page  2 
  58.  
  59.                          QDRSUM COMMAND LINE PARAMETERS                         
  60.  
  61. QDRSUM DATABASE [OPTS] [FN[/"Label"] [OPT] ...]] [!FL]  [@REL [@RF [@OPT] ...]
  62.        [>OUTPUT]
  63. where:  " ...  " indicates possible additional parameters similar to those pre- 
  64.         ceding the periods, and                                                 
  65.                                                                                 
  66.      DATABASE is the name of the PC-FILE+ database, excluding extension.
  67.  
  68.      OPTS are from the following possible options:
  69.  
  70.      /-    Database record structure display starts with byte 0, not 1          
  71.  
  72.      /~    Do not perform tilde inversions on the contents of fields            
  73.  
  74.      /#    Place a page number at the top of each  report  page.    Unless  the 
  75.            galley option (/G) is used, it is always right-aligned.              
  76.  
  77.      /1[S] Use first field named as a primary key.   If S included,  shows sum- 
  78.            mary statistics for the primary key.  S is assumed if /D not used    
  79.  
  80.      /2[S] Use second field as a secondary key,  turns on /1 option.   If S  is 
  81.            included,   shows  secondary  summary statistics,  and turns on /1S. 
  82.            Detail lines are indented two spaces when /2 is on  and  /H  is  not 
  83.            specified.  S is assumed if /D option not used                       
  84.  
  85.      /B    Remove trailing blanks in field values.  /H overrides this option    
  86.                                                                                 
  87.      /C    Do not perform CATEGORY# translation (see CATEGORY.DOC)              
  88.  
  89.      /G    Perform galley proof function:   even numbered pages will not have a 
  90.            left margin applied, and any page number is at the left on top.      
  91.  
  92.      /L#   Number of lines per screen/page (default = 24)                       
  93.  
  94.      /M#   Number of spaces to precede each print line (left margin)            
  95.  
  96.      /P    Change defaults to those for a printer file, i.e. assume /L63, if /L 
  97.            not  given,   do  not pause at each page break,  and use form feeds, 
  98.            unless /F follows--not needed for redirected output.                 
  99.  
  100.      /F    Do not use form feeds, even when /P is given                         
  101.  
  102.      /R    Run various primary key header and detail lines together on the same 
  103.            page--do not force a new page at such database "breaks"              
  104.  
  105.      /T"Title string" [/N]  The title for top of each page (quotes required).
  106.            Title is centered.   If /N specified,  title is printed  separately, 
  107.            Otherwise, any primary key is printed next to the title.             
  108.  
  109.      /U    Perform case-sensitive comparisons with selection criteria           
  110.  
  111.      /W#   Screen or page width (default = 79).   Controls centering of titles, 
  112.            make smaller with shorter detail lines for better appearance         
  113.  QDRSUM                                                                 Page  3 
  114.  
  115.                    QDRSUM COMMAND LINE PARAMETERS, continued                    
  116.  
  117.      /D    Include detail lines in the report.  Makes options below valid:      
  118.  
  119.      /A#   Number of records to print across a page.  Default is 1              
  120.  
  121.      /H    Print  header  line of field labels.   Labels are,  by default,  the 
  122.            field names, overridden by any label string following a field name   
  123.  
  124.      FN    The name of a field in the database,  selects the first field  whose 
  125.            leading characters match those given on the command line             
  126.  
  127.      "Label"  A label to use in place of the field name within the report
  128.  
  129.      OPT is one of the following options:
  130.  
  131.      /I#   Number of spaces to indent prior field (default is one space)        
  132.  
  133.      /Ec   'c' is a character to print after prior field (overwrites /N)        
  134.  
  135.      /N    Place a new line after prior field (overwrites /E).                  
  136.  
  137.      FL    File from which to read additional command line arguments.  The only 
  138.            arguments not permitted in the file are the database name,   another 
  139.            !FL specification,  or redirection (which is handled by DOS).   More 
  140.            than one line of arguments is allowed in the file FL.                
  141.  
  142.      REL   The name of a related database with a field identical to  the  first 
  143.            field (primary key) given for the database DATABASE.  See page 10    
  144.  
  145.      RF    The  name of a field in REL database,  selects the first field whose 
  146.            leading characters match those given on the command line.            
  147.  
  148.      OPT is as shown above, applied to the related database fields' displays
  149.  
  150.      >OUTPUT  Sends report's output to a file named OUTPUT.   If no redirection 
  151.               is specified,  report goes to the screen.   QDRSUM will take note 
  152.               if the output is redirected,  and assume printer  output  format, 
  153.               using  form feeds,  length of 63 lines,  if /L is not given,  and 
  154.               will not pause at the end of each page.                           
  155.  
  156.  
  157.      To set the stage for further explanations,  let's use the output of a call 
  158. on QDRSUM with only a data base name.  The following,  captured by redirection, 
  159. shows the EMPLOYEE database layout:
  160.  
  161.  
  162. Field # 1 =         Name is  20 bytes long, starting at byte # 1
  163. Field # 2 =     Position is  26 bytes long, starting at byte # 21
  164. Field # 3 =          sex is   1 bytes long, starting at byte # 47
  165. Field # 4 =         dept is  16 bytes long, starting at byte # 48
  166. Field # 5 =       empnum is   4 bytes long, starting at byte # 64
  167. Total record length = 68
  168.  
  169. Database is unsorted
  170. Database has 1 records (some may be deleted)
  171.  QDRSUM                                                                 Page  4 
  172.  
  173.      As you can see, it is a small company.   Actually,  we just took the snap- 
  174. shot after only one entry was put in.   It is also unsorted--PC-FILE+  has  not 
  175. marked the index with a sort key.
  176.  
  177.      The  above layout only shows the structure,  not how the database is used. 
  178. Below is the intended use for each field:
  179.  
  180.      NAME:        Last name, followed by ~, followed by First name
  181.      POSITION:    Job title
  182.      SEX:         F(emale) or M(ale)
  183.      DEPT:        Name or number of department
  184.      EMPNUM:      Employee Identification Number
  185.  
  186.      As mentioned above,  QDRSUM has two main functions,   summary  and  detail 
  187. report  creation.   Let's first examine the summary functions,  using the above 
  188. database, plus two others.
  189.  
  190.  
  191.                             SUMMARY REPORT FUNCTION                             
  192.  
  193.      Subtotals are maintained for all fields named,  if detail reporting is not 
  194. requested.  At most two subtotals are maintained for detail reporting.   A sub- 
  195. total  is  produced  for a field whenever its value or that of an earlier named 
  196. field changes.   The point in the database where such a change takes  place  is 
  197. called  a break.   Subtotals are printed for the rightmost field on the command 
  198. line and back to the leftmost field for which the break applies.
  199.  
  200.      Using the EMPLOYEE database,  let's fill in a few entries and see how  the 
  201. subtotals go.  The listing below shows the database:
  202.  
  203.                          Report for database EMPLOYEE
  204.  
  205.       Dept                Position          S         Name         EmpN
  206. ================ ========================== = ==================== ====
  207. Bear Family      Bottle Washer              M Father Bear          0001
  208. Bear Family      Chief Cook                 F Mother Bear          0002
  209. Bear Family      Food Eater & Bed Messer    F Sister Bear          0005
  210. Bear Family      Food Eater & Bed Messer    M Baby Bear            0003
  211. Human Family     Food Eater & Bed Messer    F Goldilocks           0004
  212. =======================================================
  213.  
  214. There are a total of 5 matching records in the database
  215.  
  216.      The database was sorted by Dept, Position, Sex,  and then Name,  so it was 
  217. easiest to display it in the same order.   It's a silly example,  but bear with 
  218. me (sorry about that) and maybe things will become clearer.
  219.  
  220.      To get meaningful summary statistics,  fields should appear  on  the  call 
  221. line in the same order they were specified to the PC-FILE+ SORT procedure.  The 
  222. summary report shows totals, subtotals,  etc.,  for each of the fields named on 
  223. the call line, including every record chosen by the selection criteria.  
  224.  QDRSUM                                                                 Page  5 
  225.  
  226.      With the database sorted by DEPARTMENT, POSITION, and SEX, the call:
  227.  
  228.      QDRSUM EMPLOYEE /B D P S >C:DEPTSUM
  229.  
  230. shows how many female employees hold a particular position in a department, how 
  231. many males hold the same position,  and a subtotal of how many  employees  hold 
  232. that  position  in  a  department.    The  next  level  subtotal tells how many 
  233. employees are in the department,  then similar summaries are  given  for  other 
  234. departments, and the grand total gives the total employees in the database.
  235.  
  236.      Below is the result from our sample database:
  237.                          Report for database EMPLOYEE
  238.  
  239. 1 record  has  Sex=M & Position=Bottle Washer & Dept=Bear Family
  240. ----------------------------------------------------------
  241.   1 record  has  Position=Bottle Washer & Dept=Bear Family
  242.  
  243. 1 record  has  Sex=F & Position=Chief Cook & Dept=Bear Family
  244. -------------------------------------------------------
  245.   1 record  has  Position=Chief Cook & Dept=Bear Family
  246.  
  247. 1 record  has  Sex=F & Position=Food Eater & Bed Messer & Dept=Bear Family
  248. 1 record  has  Sex=M & Position=Food Eater & Bed Messer & Dept=Bear Family
  249. --------------------------------------------------------------------
  250.   2 records have Position=Food Eater & Bed Messer & Dept=Bear Family
  251.  
  252. -----------------------------------
  253.     4 records have Dept=Bear Family
  254.  
  255. 1 record  has  Sex=F & Position=Food Eater & Bed Messer & Dept=Human Family
  256. ---------------------------------------------------------------------
  257.   1 record  has  Position=Food Eater & Bed Messer & Dept=Human Family
  258.  
  259. ------------------------------------
  260.     1 record  has  Dept=Human Family
  261.  
  262. =======================================================
  263.  
  264. There are a total of 5 matching records in the database
  265.  
  266.  
  267.      To produce a report summarizing employees by sex and by position within  a 
  268. department:  sort the database by SEX, POSITION, and DEPARTMENT.  The call:
  269.  
  270.      QDRSUM EMPLOYEE /B SEX POS DEP >C:EMPSEX.SUM
  271.  
  272. produces  a summary showing how many female employees hold each position within 
  273. each department,  and subtotals of how many female employees hold each position 
  274. within the company, and a final subtotal of how many female employees there are 
  275. in the database.   Then the same  information  would  be  given  for  the  male 
  276. employees.    Finally,  a grand total of how many employees are in the employee 
  277. database is printed. 
  278.  
  279.      The listing on the next page shows the output for our sample database:
  280.  QDRSUM                                                                 Page  6 
  281.  
  282.                          Report for database EMPLOYEE
  283.  
  284. 1 record  has  Dept=Bear Family & Position=Chief Cook & Sex=F
  285. --------------------------------------------
  286.   1 record  has  Position=Chief Cook & Sex=F
  287.  
  288. 1 record  has  Dept=Bear Family & Position=Food Eater & Bed Messer & Sex=F
  289. 1 record  has  Dept=Human Family & Position=Food Eater & Bed Messer & Sex=F
  290. ---------------------------------------------------------
  291.   2 records have Position=Food Eater & Bed Messer & Sex=F
  292.  
  293. ------------------------
  294.     3 records have Sex=F
  295.  
  296. 1 record  has  Dept=Bear Family & Position=Bottle Washer & Sex=M
  297. -----------------------------------------------
  298.   1 record  has  Position=Bottle Washer & Sex=M
  299.  
  300. 1 record  has  Dept=Bear Family & Position=Food Eater & Bed Messer & Sex=M
  301. ---------------------------------------------------------
  302.   1 record  has  Position=Food Eater & Bed Messer & Sex=M
  303.  
  304. ------------------------
  305.     2 records have Sex=M
  306.  
  307. =======================================================
  308.  
  309. There are a total of 5 matching records in the database
  310.  
  311.  
  312.      For a second example, consider a database, CATALOG,  taken from my CATDISK 
  313. template, whose records have the following fields: 
  314.  
  315.      FILENAME:    file name, including extension
  316.      VOL_NAME:    volume label of diskette containing the file
  317.      SIZE:        size of the file
  318.      DATE:        date of creation or last update for the file)
  319.      CATEGORY:    type of file--Communications, Database, etc.
  320.      CAT_GRP:     used to group many files of one category together
  321.      DESCRIPTION: Describes the specific function of the file
  322.  
  323.      The database layout shown by QDRSUM CATALOG is:
  324.  
  325. Field # 1 =    File_Name is  12 bytes long, starting at byte # 1
  326. Field # 2 =         Date is   8 bytes long, starting at byte # 13
  327. Field # 3 =         Size is   6 bytes long, starting at byte # 21
  328. Field # 4 =     Vol_Name is  11 bytes long, starting at byte # 27
  329. Field # 5 =     Category is  10 bytes long, starting at byte # 38
  330. Field # 6 =      Cat_Grp is   2 bytes long, starting at byte # 48
  331. Field # 7 =  Description is  37 bytes long, starting at byte # 50
  332. Total record length = 87
  333.  
  334. Database is sorted by File_Name
  335. Database has 4181 records (some may be deleted)
  336.  QDRSUM                                                                 Page  7 
  337.  
  338.      The following produces a summary of the number of files per category, plus 
  339. a count of all files in the catalog:
  340.  
  341.      QDRSUM B:CATALOG CATEGORY
  342.  
  343. The printout below is the tail end of the output from the call above:
  344.  
  345.    6 records have Category=PROJ.MGMT.
  346.   11 records have Category=RAM DISK  
  347.   15 records have Category=SORT UTIL.
  348.   35 records have Category=SORTED DIR
  349.   19 records have Category=SOUND EFF.
  350.   12 records have Category=SPOOLER   
  351.  121 records have Category=SPREADSHT.
  352.   29 records have Category=STATISTICS
  353.    5 records have Category=SUPT.DECIS
  354.  111 records have Category=TEXT EDIT.
  355.   59 records have Category=UNKNOWN   
  356.  211 records have Category=VARIOUS   
  357. ==========================================================
  358.  
  359. There are a total of 4181 matching records in the database
  360.  
  361.  
  362.      Full  field names are not required,  just enough characters to distinguish 
  363. field names from each other.  The call above could have been: 
  364.  
  365.      QDRSUM B:CATALOG C
  366.  
  367.      The following call produces a summary of the number of  files  per  volume 
  368. per  category,   plus  associated subtotals,  for categories beginning with the 
  369. letter "A" to categories beginning with the letter "P":
  370.  
  371.      QDRSUM B:CATALOG CATEGORY VOL_NAME/"Volume Name"
  372.      CATEGORY>="A" & CATEGORY<="P"
  373.  
  374. The printout below shows the first few lines of output from the above call:
  375.  
  376.                         Report for database B:CATALOG
  377.  
  378.    1 record  has  Volume Name=023WPC701   & Category=AID: ASSMY
  379.    1 record  has  Volume Name=024WPC702   & Category=AID: ASSMY
  380.    2 records have Volume Name=028WPC902   & Category=AID: ASSMY
  381.    1 record  has  Volume Name=037LANG01   & Category=AID: ASSMY
  382.    1 record  has  Volume Name=052MISCEL03 & Category=AID: ASSMY
  383.    9 records have Volume Name=070BCGI10   & Category=AID: ASSMY
  384.    9 records have Volume Name=085BCGI25   & Category=AID: ASSMY
  385.    7 records have Volume Name=119NY83JUL  & Category=AID: ASSMY
  386.    3 records have Volume Name=121NY84JAN  & Category=AID: ASSMY
  387.    1 record  has  Volume Name=141NY86AUG  & Category=AID: ASSMY
  388. ---------------------------------------
  389.     35 records have Category=AID: ASSMY
  390.  
  391.    3 records have Volume Name=004WPC303   & Category=AID: BASIC
  392.    1 record  has  Volume Name=005WPC304   & Category=AID: BASIC
  393.    6 records have Volume Name=023WPC701   & Category=AID: BASIC
  394.  QDRSUM                                                                 Page  8 
  395.  
  396.      In  both  of  the above cases,  the database CATALOG should be sorted with 
  397. CATEGORY as the primary sort key.   In the second case,  VOL_NAME should  be  a 
  398. secondary sort key. 
  399.  
  400.      By using a primary key, you can get a less repetitious printout:
  401.  
  402.      QDRSUM CATALOG CAT VOL/"Volume Name" /1S /P /L0 /F /T"CATALOG" /W44 
  403.  
  404.      The  above  call  eliminates  form feeds and page breaks.   As the line is 
  405. shown, no redirection takes place,  so output comes to the screen.   Use Ctrl-S 
  406. to stop the output as you wish,  and Ctrl-C to terminate the program.   I often 
  407. use this technique to check out formats of output before final printing.    The 
  408. following shows the first few lines of the output from the above command:
  409.  
  410.        CATALOG, Category = AID: ASSMY
  411.  
  412.      1 record  has  Volume Name=023WPC701  
  413.      1 record  has  Volume Name=024WPC702  
  414.      2 records have Volume Name=028WPC902  
  415.      1 record  has  Volume Name=037LANG01  
  416.      1 record  has  Volume Name=052MISCEL03
  417.      9 records have Volume Name=070BCGI10  
  418.      9 records have Volume Name=085BCGI25  
  419.      7 records have Volume Name=119NY83JUL 
  420.      3 records have Volume Name=121NY84JAN 
  421.      1 record  has  Volume Name=141NY86AUG 
  422. -------------------------------------
  423.   35 records have Category=AID: ASSMY
  424.  
  425.        CATALOG, Category = AID: BASIC
  426.  
  427.      3 records have Volume Name=004WPC303  
  428.      1 record  has  Volume Name=005WPC304  
  429.      6 records have Volume Name=023WPC701  
  430.  
  431.  QDRSUM                                                                 Page  9 
  432.  
  433.                            DETAIL REPORTING FUNCTION                            
  434.  
  435.      Let's  now  turn  to the subject of detail reports.   When /D is used on a 
  436. call to QDRSUM,  subtotals are not kept unless either /1S or  /2S  is  used  as 
  437. well.  The listing of the EMPLOYEE database on page 4 was created by:
  438.  
  439.      QDRSUM EMPLOYEE /D /H DEPT POSITION SEX NAME EMPNUM
  440.  
  441.  
  442.      At the start of each new page,  a title,  either that given by the /T  op- 
  443. tion,   or the phrase "Report of database" followed by the name of the database 
  444. will be printed,  centered within the limits given by the  page  width  option, 
  445. whose default value is 79 characters to prevent "bouncing" at end of line.
  446.  
  447.      Subtotals  are  maintained the same way as described above,  and are shown 
  448. after printing any requested detail fields for each selected record.   Whenever 
  449. a  key  field  changes,  any requested subtotals are printed.   The subtotal is 
  450. separated from the lines above by a line of dashes,  and followed  by  a  blank 
  451. line.    The key field for which the subtotal applies is shown,  with the asso- 
  452. ciated value.
  453.  
  454.      If only the secondary key changes and there is room on the  page,   a  new 
  455. subtitle  line  is  printed  with  any associated detail lines from the current 
  456. record.   A subtitle line is not printed without the selected detail fields  if 
  457. there is not room before the bottom of the page.   If subtotal lines do not all 
  458. fit at the bottom of a page,  a new subtitle will be printed on the  next  page 
  459. with  the  subtotal.    In  the  case of only the total for a primary key being 
  460. pushed to the next page, only a title, and no subtitle line, precedes the total 
  461. lines.
  462.  
  463.      The  call below produces a listing of all employees,  arranged by position 
  464. within departments.   A form feed is emitted for each new department,  and sum- 
  465. mary information follows each position and department listing:
  466.  
  467.      QDRSUM EMPLOYEE /D /B /2S DEPT POS NAME >DEPTPOS.LST
  468.  QDRSUM                                                                 Page 10 
  469.  
  470.                Report for database EMPLOYEE, Dept = Bear Family
  471.  
  472. Position = Bottle Washer
  473.   Father Bear
  474. -------------------------------------
  475.   1 record has Position=Bottle Washer
  476.  
  477. Position = Chief Cook
  478.   Mother Bear
  479. ----------------------------------
  480.   1 record has Position=Chief Cook
  481.  
  482. Position = Food Eater & Bed Messer
  483.   Sister Bear         
  484.   Baby Bear           
  485. -------------------------------------------------
  486.   2 records have Position=Food Eater & Bed Messer
  487.  
  488. -------------------------------
  489. 4 records have Dept=Bear Family
  490.  
  491. (A Form Feed was here)
  492.                Report for database EMPLOYEE, Dept = Human Family
  493.  
  494. Position = Food Eater & Bed Messer
  495.   Goldilocks
  496. -----------------------------------------------
  497.   1 record has Position=Food Eater & Bed Messer
  498.  
  499. ------------------------------
  500. 1 record has Dept=Human Family
  501.  
  502. =======================================================
  503.  
  504. There are a total of 5 matching records in the database
  505.  
  506.  
  507.      To get a listing of each department's job positions and names  of  employ- 
  508. ees  holding  each  position followed by a comma after each name and the sex of 
  509. the employee,  sort the database by department,  position,  and employee  name, 
  510. then use the following:
  511.  
  512.      QDRSUM EMPLOYEE /D /2 DEPT POSITION NAME /E, SEX >DEPTPOS.LST
  513.  
  514. The  output  is written to the file DEPTPOS.LST with form feeds at pages.   The 
  515. following is the result of running against our meager database:
  516.  QDRSUM                                                                 Page 11 
  517.  
  518.                Report for database EMPLOYEE, Dept = Bear Family
  519.  
  520. Position = Bottle Washer
  521.   Father Bear, M
  522. Position = Chief Cook
  523.   Mother Bear, F
  524. Position = Food Eater & Bed Messer
  525.   Baby Bear, M
  526.   Sister Bear, F
  527.  
  528. (A Form Feed was here)
  529.                Report for database EMPLOYEE, Dept = Human Family
  530.  
  531. Position = Food Eater & Bed Messer
  532.   Goldilocks, F
  533. =======================================================
  534.  
  535. There are a total of 5 matching records in the database
  536.  
  537.  
  538.      For another example,  let's use a database named BOOKS,  laid out like the 
  539. the BOOKINV example from CATEGORY.DOC.  Following is the database record struc- 
  540. ture for BOOKS:
  541.  
  542. Field # 1 =       AUTHOR is  40 bytes long, starting at byte # 1
  543. Field # 2 =    CATEGORY# is   2 bytes long, starting at byte # 41
  544. Field # 3 =        TITLE is  60 bytes long, starting at byte # 43
  545. Field # 4 =        COVER is   1 bytes long, starting at byte # 103
  546. Field # 5 =         COST is   6 bytes long, starting at byte # 104
  547. Field # 6 =     LOCATION is  17 bytes long, starting at byte # 110
  548. Field # 7 =      ON_LOAN is   1 bytes long, starting at byte # 127
  549. Field # 8 =      CR_DATE is   4 bytes long, starting at byte # 128
  550. Field # 9 =   COMMENTS_1 is  65 bytes long, starting at byte # 132
  551. Field # 10 =   COMMENTS_2 is  65 bytes long, starting at byte # 197
  552. Total record length = 262
  553.  
  554. Database is sorted by CATEGORY#
  555. Database has 388 records (some may be deleted)
  556. Category # 1 = COOKBOOKS
  557. Category # 2 = CHILDRENS
  558. Category # 3 = CRAFT/HOBBY/DECORATING
  559. Category # 4 = FARM/PETS/DO IT YOURSELF
  560. Category #16 = HISTORY
  561. Category #17 = DO IT YOURSELF/SKILLS
  562. Category #18 = ART
  563. Category #19 = SCIENCE FANTASY
  564.  
  565.      The Category# translation list can be  bypassed  by  calling  QDRSUM  with 
  566. BOOKS /C
  567.  QDRSUM                                                                 Page 12 
  568.  
  569.      The following call: 
  570.  
  571.      QDRSUM BOOKS /D CAT AUTH TITLE /T"MY BOOKS"
  572.  
  573. prints MY BOOKS , centered,  at the top of each screen,  CATEGORY = description 
  574. or CATEGORY# = nn centered,  authors from that category followed by the  titles 
  575. written  by each author, pausing at the end of each full screen.
  576.  
  577.      For the next example, assume a file named ARTSEL contains the following:
  578.  
  579.      CAT="03"
  580.      CAT="18"
  581.  
  582.      The  following selects those books in the CRAFT/etc. and ART categories:
  583.  
  584.      QDRSUM BOOKS /D /T"ARTS & CRAFT BOOKS" /2 CAT AUTH TITLE <ARTSEL >PRN
  585.  
  586. The output is sent to the printer (PRN),  with form feeds issued at the end  of 
  587. each page.  Each page has the title ARTS & CRAFT BOOKS.
  588.  
  589.  
  590.      In our next example,  detail lines from fields COMMENTS_1  and  COMMENTS_2 
  591. are printed below the books title,  indented two additional spaces.   If either 
  592. field is blank,  its line is not printed in the report.    Since  the  COMMENTS 
  593. fields  are  the  longest,   the page width is changed to account for this,  so 
  594. titles will be better centered on the report.   An inch margin is made  on  the 
  595. left for hole-punching.  Output goes to a file named RPT:
  596.  
  597. QDRSUM BOOKS /M10 /D /H"MY LIBRARY" /W69 C A T /N COM /I4 /N COMMENTS_2 /I4
  598. >RPT
  599.  
  600.  
  601.      Returning  to  the  CATALOG database,  the following call,  applied to the 
  602. database after it was sorted by CATEGORY, CAT_GRP, and then FILENAME:
  603.  
  604. QDRSUM CATALOG /F /D /H /1S CAT F/"FILE NAME" D S V/"VOLUME NAME" DE /W80
  605.  
  606. produces a report looking like the following excerpt, with no form feeds:
  607.  
  608.                Report for database CATALOG, Category = AID: X-REF
  609.  
  610.  File Name     Date    Size  Volume Name               Description            
  611. ============ ======== ====== =========== =====================================
  612. XC      .ARC 87-06-21  28288 162TURBOC   C Cross-reference Utility            
  613. XREF    .BAS 83-05-05   6016 023WPC701   Cross references variables in BASIC p
  614. XREF    .DOC 80-01-01    888 023WPC701   Documentation & instructions for XREF
  615. XREF    .EXE 82-08-31  28800 023WPC701   Faster cross referencing of BASIC var
  616. -------------------------------------
  617.    4 records have Category=AID: X-REF
  618.  QDRSUM                                                                 Page 13 
  619.  
  620.      The following shows multiple records per line, with header lines:
  621.  
  622.      QDRSUM CATALOG /D /H F/"FILE NAME" V/"VOLUME NAME" C /A2 /W76
  623.      F>="COMPUSRV" & F<="COMSPEC"
  624.  
  625.  
  626. produces a report looking like the following:
  627.  
  628.                         Report for database CATALOG
  629.  
  630.  FILE NAME   VOLUME NAME  Category        FILE NAME   VOLUME NAME  Category 
  631. ============ =========== ==========      ============ =========== ==========
  632. COMPUSRV.ARC 147COMMUN02 COMM.PROGM      COMPUSRV.CMD 047PROCOMM  COMM.PROGM
  633. COMPUSRV.TXT 013WPC401   INFORMATN.      COMSPEC .ASM 121NY84JAN  DOS UTIL. 
  634. COMSPEC .DOC 121NY84JAN  DOS UTIL.      
  635. ==========================================================
  636.  
  637. There are a total of 5 matching records in the database
  638.  
  639.      To show a use for the /G option, let me describe how I use it for making a 
  640. listing  of  my  PC Club's library,  using a laser printer.   We currently have 
  641. about 4200 files in the library,  spread across 170 diskettes.   I can cause my 
  642. laser  printer  to print 174 columns by 109 lines on an 8-1/2 by 11 inch paper, 
  643. and still have it readable without a magnifying glass.   I can put  the  entire 
  644. library catalog, sorted by category on 24 pages by the following command:
  645.  
  646. QDRSUM  catalog  c  /1s  f/"File Name" d s v/"Volume Name" des /D /H /# /G >PRN 
  647. /T"PC Club Library" /M9 /A2 /W165 /L109 /R
  648.  
  649.      The above call comes close to the limit of 128 characters per input  line, 
  650. but  it  makes  it.   Using the more arguments file parameter (!filename) would 
  651. allow for a cleaner and clearer invocation,  as follows.   Create a file called 
  652. CATG.ARG with the following contents:
  653.  
  654. /D /H /# /G /T"PC Club Library" /M9 /A2 /W165 /L109 /R
  655. CATEGORY /1S FILE/"File Name" DATE SIZE VOLUME/"Volume Name" DESCRIP
  656.  
  657. Call the program with the following:
  658.  
  659. QDRSUM CATALOG !CATG.ARG >PRN
  660.  
  661.      It produces a printout with a left margin wide enough for  hole  punching, 
  662. and puts it in a galley proof format, so I can do two-sided photo-copying,  and 
  663. have the even number pages set up properly.   Even numbered pages  do  not  get 
  664. indented,  and the page number is put on the left side,  preceding the centered 
  665. title consisting of the phrase "PC Club Library,  Category = " followed by  the 
  666. particular  category  starting at the top of the current page.   The /R assures 
  667. that a short category is not put on a page all alone.   Categories will be  run 
  668. together,   separated  by  two blank lines and headed by a new title and header 
  669. lines.  When the printed output is copied,  odd numbered pages on the front and 
  670. even  numbered pages on the back,  it produces a compact catalog on only twelve 
  671. sheets of paper.
  672.  QDRSUM                                                                 Page 14 
  673.  
  674.      I  also  use  the  following to create a listing of the database sorted by 
  675. filename and volume name, which results in 11 pages, only 6 sheets of paper:
  676.  
  677. QDRSUM catalog f/"File Name" v/"Volume Name" c /D /H /# /G /M15 /A4 /W156
  678. /L109 /T"PC Club Library Files" >PRN
  679.  
  680.      The  above will show four columns of file name,  volume name and category, 
  681. of all files in the database.   Notice that the placement of >PRN is  different 
  682. than  on the prior call.   At least for my versions of MSDOS 3.1 and 3.2,  this 
  683. works fine--you might want to check whether  it  matters  for  what  you  have. 
  684. Notice that /R is not given--it has no meaning when there is no primary key.
  685.  
  686.      Note  that the !moreargs provides for a clearer call line.   Create a file 
  687. named FILE.ARG, with the following lines:
  688.  
  689. /D /H /# /G /M15 /A4 /W156 /L109 /T"PC Club Library Files"
  690. FILE/"File Name" VOLUME/"Volume Name" CATEGORY
  691.  
  692. Call QDRSUM as follows to get the same effect:
  693.  
  694. QDRSUM CATALOG !FILE.ARG >PRN
  695.  
  696.  
  697.                             RELATED DATABASE LOOKUP                             
  698.  
  699.      Arguments preceded with the '@' sign are  for  related  database  lookups. 
  700. The  first  argument  must  give the name of a related database.   The database 
  701. named must have a field which has exactly the same name (except for capitaliza- 
  702. tion) as that of the primary key specified for the primary database.  The field 
  703. must also be identical in size to the primary key.
  704.  
  705.      A relational lookup is performed by finding the first record in the relat- 
  706. ed  database  which  has the same value in the primary key field as that of the 
  707. current record in the primary database.   The contents of any of the fields  in 
  708. the selected record can be displayed whenever the primary key value changes, or 
  709. at the start of a new page.
  710.  
  711.      The @/ options specify how to display the values,  just as the correspond- 
  712. ing / options do for the primary database's records.   The following example is 
  713. drawn from the CATDISK database.
  714.  
  715.      To make a Table of Contents file for one or more diskettes,  create a file 
  716. named TOC.ARG containing the following lines:
  717.  
  718. /D /T"Table of Contents" /N /H
  719. V/"VOLUME" /1 F/"FILE NAME" /I0 S/SIZE /I1 D/DATE /I1 C/CATEGORY /I1 
  720. DE/DESCRIPTION /I1
  721. @DISK @/E- @FREE @/N @DESC
  722.  
  723. Calling with the following will make a Table of Contents for the diskette in my 
  724. club's library labeled 001CATALOG:
  725.  
  726. QDRSUM CATALOG @VOLCAT !TOC.ARG >001.TOC
  727. V="001"
  728.  
  729. The output is shown at the top of the next page
  730.  QDRSUM                                                                 Page 15 
  731.  
  732.                                Table of Contents
  733.  
  734.                               VOLUME = 001CATALOG
  735.  
  736. Double-Sided 9-sect - 133K free
  737. Library Catalog Listing: Category < Games     
  738.  
  739.  FILE NAME    SIZE    DATE    CATEGORY                DESCRIPTION              
  740. ============ ====== ======== ========== =======================================
  741. CATGORY1.LST 213555 87-09-19 DSK.CATLOG Catalog Listing: Categories < Games    
  742. ELITE   .COM    256 85-03-27 PRINTER UT Sends code to Printer for Elite print  
  743. FF      .         1 87-09-19 PRINTER UT Form Feed Character                    
  744. LIST    .COM   8191 87-07-05 FILE UTIL. Lets you browse through a file on scrn 
  745. PRINT   .BAT     25 86-03-24 PRINTER UT Prints catalog listing in elite font   
  746. SEE     .BAT     11 86-03-24 FILE UTIL. Lets you browse thru Catalog listing   
  747. ==========================================================
  748.  
  749. There are a total of 6 matching records in the database
  750.  
  751.  
  752.      The  "Double-Sided  9-sect  " is the value of the field named DISK_TYPE in 
  753. the database VOLCAT,  for the record whose VOLUME_LABEL  field  has  the  value 
  754. "001"  in  the  first three characters.   "133K free" came from the field named 
  755. FREE_SPACE, and the line following was produced from a field named DESCRIPTION.
  756.  
  757.      You might notice that I did not put quotes (") around all of  the  labels. 
  758. You  really only need to use quotation marks if the label has spaces inside it, 
  759. like "FILE NAME".
  760.  
  761.  
  762.      I  hope the above examples give you some idea of how you can use QDRSUM to 
  763. get more out of your PC-FILE+ databases.   If you have any comments or  sugges- 
  764. tions, please send them to me via COMPUSERV's EASYPLEX electronic mail.
  765.  
  766.            Archie Strong, COMPUSERV USERID: [73167,1205]
  767.                                                                                 
  768.