home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / viscobv6.zip / vac22os2 / ibmcobol / samples / smrtsort / sample5.c < prev    next >
Text File  |  1995-07-18  |  2KB  |  44 lines

  1. /**********************************************************/
  2. /*                                                        */ 
  3. /*  Licensed Material -- Property of IBM                  */    
  4. /*  5765-349                                              */
  5. /*  (c) Copyright IBM Corporation 1995                    */
  6. /*  All rights reserved                                   */
  7. /*                                                        */
  8. /**********************************************************/
  9.  
  10. /**********************************************************/
  11. /*                                                        */
  12. /* SMARTsort -- sample5.c                                 */
  13. /*                                                        */
  14. /* This program demonstrates how SMARTsort can be used    */
  15. /* to filter data from a file.                            */
  16. /*                                                        */
  17. /**********************************************************/
  18.  
  19. #pragma linkage (SMARTsort,system)
  20. #include <string.h>
  21.                                           
  22. void main(void)
  23. {
  24.  
  25.  char *copy_command="-s copy -x 'filter 3b,3 eq \"L92\"'";
  26.  char copycommand[100];
  27.  
  28.  /* Define file names that will be used */
  29.  char *deptall=".\\data\\dept.all"; 
  30.  char *filtered=".\\output\\filter.out "; 
  31.  int rc;
  32.  
  33.  /**********************************************/
  34.  /* Build command string and call SMARTsort to */
  35.  /* filter data from original file             */       
  36.  /**********************************************/
  37.  strcpy(copycommand,copy_command);         
  38.  strcat(copycommand," -o ");
  39.  strcat(copycommand,filtered);
  40.  strcat(copycommand,deptall);
  41.  rc=SMARTsort(copycommand,NULL,NULL,NULL,NULL,NULL,NULL);
  42.  
  43. }
  44.