ARSDOC Query--Specify what to output?

Previous topic - Next topic

jeffs42885

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

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

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.
Call:  +1-866-533-7742  or  eMail:  jd@justinderrick.com
IBM CMOD Wiki:  https://CMOD.wiki/
FREE IBM CMOD Webinars:  https://CMOD.Training/
IBM CMOD Professional Services: https://CMOD.cloud

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

jeffs42885

Will try it and see how I make out!

I have no PERL experience so we'll see!

demaya

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

Hi Jeff,

You can try this unix command:

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

Hope this helps.

-jw

sisusteve

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