Author Topic: ARSDOC Query--Specify what to output?  (Read 4727 times)

jeffs42885

  • Guest
ARSDOC Query--Specify what to output?
« on: November 01, 2012, 06:53:33 AM »
Greetings all,

I am trying to come up with a script that Generates a list of LOAD IDs and the application group associated with them. So far, I have been successful in my first step:

arsdoc query -h odserver -u jeffy -p jeffpassword -f "folder" -G "appgroup" -i "where rdate BETWEEN 14692 and 15209" -I f

Returns:

AG,03/23/10,50127-9-0-1FAA-14692-14692
AG,03/24/10,50127-9-0-2FAA-14693-14693
AG,03/25/10,50127-9-0-3FAA-14694-14694
AG,03/26/10,50127-9-0-4FAA-14695-14695

Here is my question, and I am sure that this is more of a unix question than an actual OnDemand question, or who knows. I might be missing a flag or something. I want my output just to be the AG and the load ID. so..

AG 50127-9-0-AFAA-14692-14692


What does everyone suggest? This is on AIX..my scripting skills are so-so..

LWagner

  • Guest
Re: ARSDOC Query--Specify what to output?
« Reply #1 on: November 01, 2012, 08:19:44 AM »
Not sure about ARSDOC, but here is some SQL I use to extract information from the System Log

   SELECT                                                     
          MSG_NUM AS MSG, TIME_STAMP,                         
          SUBSTR(MSG_TEXT,31,42) AS PARTIAL_LOADID,           
          SUBSTR(MSG_TEXT,22,7) AS AGNAME,                     
          SUBSTR(MSG_TEXT,LOCATE(') Appl(',MSG_TEXT,100)+5,12)
          AS APPNAME                                           
     FROM ARSSERVR.SL2                                         
     WHERE                                                     
           MSG_NUM = 87                                       
     AND (APPNAME  LIKE 'REGULAR%' )                           
     AND   TIME_STAMP  > 0                                     
--   AND   TIME_STAMP  < (1342076400 + 86400)                 
--  FIND SOURCE TIMESTAMP BEFORE START OF INDEX MIGRATION     
--      JAN 01 2009 ??                                         
--  1342076400 IS A TIME ON  JULY 11, 2012, ABOUT 00:00 AM     
     ORDER BY TIME_STAMP;                                     

Justin Derrick

  • IBM Content Manager OnDemand Consultant
  • Administrator
  • Hero Member
  • *****
  • Posts: 2230
  • CMOD Guru for hire...
    • View Profile
    • Tenacious Consulting
Re: ARSDOC Query--Specify what to output?
« Reply #2 on: November 02, 2012, 07:01:18 AM »
Hey Jeff.

You can use shell commands to solve your issue on the command line...

OUT=`arsdoc query -h odserver -u jeffy -p jeffpassword -f "folder" -G "appgroup" -i "where rdate BETWEEN 14692 and 15209" -I f`
echo `echo $OUT |cut -d "," -f 1` `echo $OUT |cut -d "," -f 3`

I haven't tested this (obviously) but it should give you a nudge in the right direction.

If I had the choice, I'd probably write the script in Perl, since it has awesome tools for slicing-and-dicing text.  :)

Good luck!

-JD.
IBM CMOD Professional Services: http://TenaciousConsulting.com
Call:  +1-866-533-7742  or  eMail:  jd@justinderrick.com
IBM CMOD Wiki:  https://CMOD.wiki/
FREE IBM CMOD Education & Webinars:  https://CMOD.Training/

Interests: #AIX #Linux #Multiplatforms #DB2 #TSM #SP #Performance #Security #Audits #Customizing #Availability #HA #DR

jeffs42885

  • Guest
Re: ARSDOC Query--Specify what to output?
« Reply #3 on: November 02, 2012, 08:45:04 AM »
Will try it and see how I make out!

I have no PERL experience so we'll see!

demaya

  • Guest
Re: ARSDOC Query--Specify what to output?
« Reply #4 on: November 05, 2012, 08:33:41 AM »
Perl is always worth a look ;)

And if you have no expierence: you should have still a look... it's a great scripting language :)

jw

  • Guest
Re: ARSDOC Query--Specify what to output?
« Reply #5 on: November 09, 2012, 05:10:59 AM »
Hi Jeff,

You can try this unix command:

cut -d "," -f 1,3 input_file > output_file.

Hope this helps.

-jw

Steve Bechtolt

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
Re: ARSDOC Query--Specify what to output?
« Reply #6 on: February 14, 2013, 04:52:38 AM »
Use the -N option on the arsdoc query to specify which fields you want returned.
you can also us the -e <delim> to set the field delimiter character
Steve Bechtolt
IBM Certified Solutions Expert - IBM Content Management - OnDemand Multiplatform
ERM as a Service - DXC Technology