The following information applies to OnDemand for Multiplatforms. The following information applies to OnDemand for i. IBM Content Manager OnDemand for i, Version 7.2.+

Examples

  1. The following shows how to use the GET function to retrieve documents and save them in a file in the current directory.
      arsdoc get -h QUSROND -f "Student Information" -o student
      -c -S 1/1/97,12/31/97 -i "WHERE student='001200340056'" -v
    The ARSDOC program saves all of the documents that match the query in the following output file: student
  2. The following shows how to use the GET function and a parameter file to run more than one query at a time. The parameter file is in the current directory. The output files are saved in the current directory.
      arsdoc get -h QUSROND -F parmfile -v
    The parameter file contains two queries:
    [-f "Student Information"] [-S 1/1/97,12/31/97] [-o (student)(type)] \
    [-i "WHERE student='123420010056' AND type='B' OR type='G' OR type='T'"]
    
    [-f "Student Information"] [-S 1/1/97,12/31/97] [-o (student)(type)] \
    [-i "WHERE student='123450011917' AND type='B' OR type='G' OR type='T'"]
    Assuming that documents exist for all of the specified types, the ARSDOC program creates the following output files:
    • 123420010056.Bills
    • 123420010056.Grades
    • 123420010056.Transcripts
    • 123450011917.Bills
    • 123450011917.Grades
    • 123450011917.Transcripts
  3. The following shows how to use the GET function to retrieve documents, write the documents to a file, and generate and save generic index data for the documents that match the query. The example shows how to specify the name of a public named query that is valid for the specified folder.
      arsdoc get -h QUSROND -f "Student Information"
      -a -c -g -o student -q "3rd yr students GPA>3.5" -N -v
    The number of output files that the ARSDOC program generates is a factor of the number of application groups queried, the applications contained in the application groups, whether the data is AFP and if so, the versions of resource groups in each application. At a minimum, for AFP data with one version of the resource group and one application group, the ARSDOC program generates three output files. For example:
    • student.1.Student Information.TRANSCRIPTS.ind
    • student.1.Student Information.TRANSCRIPTS.out
    • student.1.Student Information.TRANSCRIPTS.res
    For AFP data, if there is more than one version of the resource group per application, then the ARSDOC program can generate additional output files. For example:
    • student.1.Student Information.TRANSCRIPTS.ind
    • student.1.Student Information.TRANSCRIPTS.out
    • student.1.Student Information.TRANSCRIPTS.res
    • student.2.Student Information.TRANSCRIPTS.out
    • student.2.Student Information.TRANSCRIPTS.ind
    • student.2.Student Information.TRANSCRIPTS.res
    If the application group contains more than one application, then the ARSDOC program can generate additional output files. For example:
    • student.1.Student Information.Bills.ind
    • student.1.Student Information.Bills.out
    • student.1.Student Information.Bills.res
    • student.2.Student Information.Grades.out
    • student.2.Student Information.Grades.ind
    • student.2.Student Information.Grades.res
  4. The following shows how to use the QUERY function to generate a list of items and save the list in a file in the current directory.
      arsdoc query -h QUSROND -f "Student Information" -o query1.out -H 
      -S 1/1/97,12/31/97 -i "WHERE student='0012-0034-0056' AND type='B' OR 
      type='G' OR type='T'" -v
  5. The following shows how to use the QUERY function and a parameter file to run more than on query at a time. The parameter file is in the current directory. The output files are saved in the current directory.
      arsdoc query -h QUSROND -F parmfile -v
    The parameter file contains three queries:
      [-f "Student Information"] [-i "WHERE type='B'"] [-o query2.out] \
      [-S 1/1/97,12/31/97] [-H] [-N (student)(id)(p_date)]
    
      [-f "Student Information"] [-i "WHERE type='G'"] [-o query3.out] \
      [-S 1/1/97,12/31/97] [-H] [-N (student)(id)(p_date)]
    
      [-f "Student Information"] [-i "WHERE type='T'"] [-o query4.out] \
      [-S 1/1/97,12/31/97] [-H] [-N (student)(id)(p_date)]
  6. The following example shows how to use the QUERY function to search a specific application group:
      arsdoc query -h QUSROND -i "where Date_Taken BETWEEN 9863 AND 11531"
      -G load-scanned-images-jpeg -o jpeg -v
  7. The following example shows how to use the ADD function to add a document to the Credit Card Statements folder:
      arsdoc add -h QUSROND -o /newdata/crd.dat -n "crd_date=01/21/98" 
      -n "account='000-000-000'" -n balance=123.45 -n "name='John Watpole'" 
      -f "Credit Card Statements" -g CRD -a CRD -v
  8. The following example shows how to use the UPDATE function to update a document in the Credit Card Statements folder, changing the balance from 123.45 to 0.00:
      arsdoc update -h QUSROND -i "where account='000-000-000' and 
      name='John Watpole'" -n "balance=0.00" -S 1/1/97,12/31/97 -f 
      "Credit Card Statements" -g CRD -v
  9. The following example shows how to use the DELETE function to delete a document from the Credit Card Statements folder:
      arsdoc delete -h QUSROND -i "where account='000-000-000' and 
      name='John Watpole'" -f "Credit Card Statements" -S 1/1/97,12/31/97 
      -v
  10. The following example shows how to use the PRINT function to send the documents that match a query to a server printer:
      arsdoc print -h QUSROND -P 
    svrprt1 -i "where account='000-000-000' and name='John Watpole'" 
    -f "Credit Card Statements" -S 1/1/97,12/31/97 -v
  11. You can use the ARSDOC program to use the ADD function to add an index that points to an existing document. For example, assume that you loaded a bank statement for account number 000-000-000, date 5/23/97, and account name Joe Smith. You want to add a new index, but point to the existing statement. The new index uses the same account number and date, but contains a different account name (for example, Sally Smith). After adding the index, if a query is run with account name Joe Smith or Sally Smith, the same bank statement will be retrieved. To add an index for an existing document:
      arsdoc add -h QUSROND -i "where sdate=10005 and account='000-000-000' 
      and name='Joe Smith'" -n "sdate=5/23/97" -n "account=000-000-000" -n 
      "name='Sally Smith'" -f "Credit Card Statements" -S 1/1/97,6/31/97 -v
  12. The following example shows how to use the QUERY function to limit a search to the documents that were loaded into the system under a specific load ID. For example, assume that the specified folder could be used to search several application groups; each application group contains more than one application; there are 500,000 documents in the application groups. By using the -x parameter, the query will be limited to the set of documents that was loaded into the system under the specified load ID. Without the -x parameter, the query is run against all 500,000 documents. Start of change
      arsdoc query -h QUSROND -x 8495-53-0-1FAA-20130627000000-20130627000000-8496
      -f load-scanned-images -q query -o out -v
    End of change
  13. The following example shows how to use the QUERY function to limit a search to the documents that were loaded into the system under a specific load ID. In the example, the load ID, application group name, and query string are provided. The search is limited to the application group and only those documents that were loaded into the system under the specified load ID. Start of change
      arsdoc query -h QUSROND -x 8495-53-0-1FAA-20130627000000-20130627000000-8496
      -i "where Date_Taken BETWEEN 9863 AND 11531" -G load-scanned-images-jpeg 
      -o jpeg -v
    End of change
  14. The following example shows how to use the QUERY function to limit a search to the documents that were loaded into the system under a specific load ID. In the example, the load ID, folder name, application group name, and named query are provided. The search is limited to the application group and only those documents that were loaded into the system under the specified load ID. Because a folder was specified, a named query can be used. (If an application group name is specified and a folder name is not specified, a named query cannot be used, because a named query is associated with a folder.) Start of change
      arsdoc query -h QUSROND -x 8495-53-0-1FAA-20130627000000-20130627000000-8496
      -f load_scanned-images -q query -G load-scanned-images-jpeg -o jpeg -v
    End of change
  15. Start of change The following example shows how to use the GET function and an index file to retrieve documents from the system. The index file was generated for the set of documents that was loaded into the system under the specified load ID. The example also shows the use of a load ID format prior to version 7.2. When using the -X parameter, the database is not queried; rather, documents are retrieved based on the information in the index file.
      arsdoc get -h QUSROND -X 19867-025-0-3FAA-10136-10136
      -G load-scanned-images-jpeg -o jpeg -v
    End of change
  16. -A parameter: The following are two examples of using the ARSDOC GET function with the -A parameter.
    Tip: In the following examples, the -u and -p parameters are not required for IBM® i.
    • To retrieve public text annotations:
      arsdoc get -u oduser -p passwd -h odserver -f "CRD" -q named_query
       -o loaddata -a -g -c -N -A 0 -v
    • An example of the messages that are generated by the ARSDOC program. New messages are highlighted:
      03/10/2004 10:32:12: Starting arsdoc. Version: 8.4.1.0
      
      03/10/2004 10:32:14: arsdoc get -u oduser -h odserver -f CRD -q named_query -o loaddata -a -g -c -N -A 0 -v
      
      03/10/2004 10:32:14: Attempting login for userid 'oduser' on server 'odserver' ...
      
      03/10/2004 10:32:20: Login successful
      
      03/10/2004 10:32:20: Searching for folder 'CRD' ...
      
      03/10/2004 10:32:27: Search successful
      
      03/10/2004 10:32:27: Searching for documents in 'CRD' ...
      
       03/10/2004 10:32:28: Querying database with SQL string 'where account = '000-000-000'' 
      
      03/10/2004 10:32:56: Search successful
      
      03/10/2004 10:32:56: 1 document(s) have been queried. Retrieving 1 document(s).
      
      03/10/2004 10:34:05: (1): Retrieving document for userid 'oduser' ...
      
      03/10/2004 10:34:05: Document successfully retrieved and stored in file 'loaddata.2.CRD.CRD.out'
      
       03/10/2004 10:34:15: Writing generic indexer file(s).
      
      03/10/2004 10:34:46: '1' annotations were written to file 'loaddata.2.CRD.CRD.ann'
      
      03/10/2004 10:34:46: A total of 1 annotations were written to file 'loaddata.2.CRD.CRD.ann'
      
      03/10/2004 10:34:53: Generic indexer file 'loaddata.2.CRD.CRD.ind' has been successfully created. 
      
      03/10/2004 10:34:54: arsdoc completed.
  17. Start of change The following example is for the -B option. You want the command line to print all of the documents in the Credit Card Statements folder that have an account number of 000-000-000. The documents are to be printed in sorted ascending order based on the balance:
    arsdoc print -u oduser -p odpasswd -h odserver -i "where account = '000-000-000'"
     -f "Credit Card Statements" -P odprinter -B balance -v.
    End of change
  18. -Q parameter: The following is an example command and an example file that contains SQL statements.
    Example command:
    arsdoc get -h QUSROND -f "Labor Reports" -Q /home/dbryant/QSTRING.TXT -d /home/dbryant -o 
    REPORTS -a -g -c -N -v
    Example file containing SQL statements:
    # Query on one line
    where EMPLNAME = 'B ROCKER'
    # Query on multiple lines
    where EMPLNAME\
    = 'M VESPA'
  19. You can run ARSDOC GET with the -a and -g parameters to create generic indexer files. This also creates the .res resource file.
    arsdoc get -c -h <host> -u <usr> -p <pwd> -G <ApplGrp> -F <Folder> -i
     <SQL Query> -a -g -n -o <filename> -S <data range>
    If the -S <data range> is not specified, all tables are searched, and that results in poor performance.
  20. HOLD_ADD function:
    Tip: In the following example, the -u and -p parameters are not required for IBM i.
    arsdoc hold_add -u oduser -p odpasswd -h odserver -l hold_audit -f 
    "Monthly Status Reports" -i "where code='TX' and sdate=14117" -v
  21. HOLD_RELEASE function:
    Tip: In the following example, the -u and -p parameters are not required for IBM i.
    arsdoc hold_release -u oduser -p odpasswd -h odserver -l hold_audit -f 
    "Monthly Status Reports" -i "where code='TX' and sdate=14117" -v
  22. CFSOD_FED function:
    arsdoc cfsod_fed -u oduser -p odpasswd -h odserver -f 
    "Monthly Status Reports" -i "where code='TX' and sdate=14117" -v
  23. Start of change FTI_ADD function:
    arsdoc fti_add -u oduser -p odpasswd -h odserver -f 
    "Monthly Status Reports" -i "where code='TX' and sdate=14117" -v
    End of change


Feedback

Last updated: November 2013


© Copyright IBM Corporation 2014.
This information center is powered by Eclipse technology. (http://www.eclipse.org)