How to fetch data from PS file



IBM's Command List programming language & Restructured Extended Executor

How to fetch data from PS file

Postby ravisankarc » Wed Jan 11, 2012 6:50 pm

Hi Team,

My input dataset contains the below information :

ARC0680I HSM EXPIREBV STARTED 27 Dec 2011 01:00:00
ARC0620I HSM VOLUME DUMP STARTED 27 Dec 2011 01:00:01
ARC0621I HSM VOLUME DUMP ENDED 27 Dec 2011 01:06:39
ARC0520I HSM PRIMARY SPACE MANAGEMENT STARTED 27 Dec 2011 01.06.39
ARC0521I HSM PRIMARY SPACE MANAGEMENT ENDED 27 Dec 2011 01.22.17
ARC0517I HSM SECONDARY SPACE MANAGEMENT STARTED 27 DEC 2011 01.22.17
ARC0518I HSM SECONDARY SPACE MANAGEMENT ENDED 27 Dec 2011 01.25.14
ARC0681I HSM EXPIREBV ENDED 27 Dec 2011 02:06:17
ARC0680I HSM EXPIREBV STARTED 28 Dec 2011 01:00:00
ARC0620I HSM VOLUME DUMP STARTED 28 Dec 2011 01:00:01
ARC0621I HSM VOLUME DUMP ENDED 28 Dec 2011 01:07:39
ARC0520I HSM PRIMARY SPACE MANAGEMENT STARTED 28 Dec 2011 01.07.40
ARC0521I HSM PRIMARY SPACE MANAGEMENT ENDED 28 Dec 2011 01.22.17
ARC0517I HSM SECONDARY SPACE MANAGEMENT STARTED 28 DEC 2011 01.22.17
ARC0518I HSM SECONDARY SPACE MANAGEMENT ENDED 28 Dec 2011 01.45.24
ARC0681I HSM EXPIREBV ENDED 28 Dec 2011 02:16:17
ARC0680I HSM EXPIREBV STARTED 29 Dec 2011 01:00:00
ARC0620I HSM VOLUME DUMP STARTED 29 Dec 2011 01:00:01
ARC0621I HSM VOLUME DUMP ENDED 29 Dec 2011 01:07:39

My requirement is :

The ARC messages(messages in first column) from system are captured and placed in my input dataset. If any of the ARC message is not found with respective date(suppose on 29th Dec 2011 if ARC0680I message is not there in input dataset) then it should give that particular function has not started on so and so date. For example if ARC message ARC0680I is not found on 29th then it should display as :

HSM EXPIREBV has not started 29 Dec 2011 01:00:00

If the same ARC message is not appeared on both the dates then it should display as :

HSM EXPIREBV has not started 28 Dec 2011 01:00:00
HSM EXPIREBV has not started 29 Dec 2011 01:00:00

Hope I am clear in explaining my requirement. Could anyone look into it and help me in writing REXX code. I have tried with IF THEN DO ELSE and SELECT WHEN OTHERWISE parameters in REXX but I am not able to get the desired output.

Please help me in this issue.

Thanks N Regards
Ravi
ravisankarc
 
Posts: 47
Joined: Thu Aug 27, 2009 2:18 am
Has thanked: 0 time
Been thanked: 0 time

Re: How to fetch data from PS file

Postby BillyBoyo » Wed Jan 11, 2012 6:59 pm

Can you show us the code you have an the output which indicates that it is not working. In the Code tags, please.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: How to fetch data from PS file

Postby ravisankarc » Wed Jan 11, 2012 7:39 pm

Below is the IF COND code i tried. I am sorry, I didn't understand what do you mean by tags...

J=1                                                 
DO I=1 TO STEM1.0                                   
PARSE VAR STEM1.I X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11         
                                                       
 IF X1 >< 'ARC0680I' THEN DESP = 'EXPIREBV NOT STARTED' 
 DO                                                       
 OUT.J = DESP                                             
 ELSE DO                                                 
 IF X1 >< 'ARC0681I' THEN DESP = 'EXPIREBV NOT ENDED'   
 DO                                                       
 OUT.J = DESP   
END
END
END
END


Below is the code which I tried with SELECT WHEN OTHERWISE :

J=1                                                 
DO I=1 TO STEM1.0                                   
PARSE VAR STEM1.I X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11
SELECT
 WHEN X1 >< "ARC0620I" THEN DO                         
   OUT.J = EXPIREBV NOT STARTED X6 X7 X8 X9 X10 X11     
   END                                                 
 WHEN X1 >< "ARC0621I" THEN DO                         
   OUT.J = RAVI NOT STARTED X6 X7 X8 X9 X10 X11         
   END                                                 
 WHEN X1 >< "ARC0520I" THEN DO                         
   OUT.J = SANKAR NOT STARTED X6 X7 X8 X9 X10 X11       
   END                                                 
 WHEN X1 >< "ARC0521I" THEN DO                         
   OUT.J = BINESH NOT STARTED X6 X7 X8 X9 X10 X11       
   END                                                 
 WHEN X1 >< "ARC0517I" THEN DO                         
   OUT.J = NAIR NOT STARTED X6 X7 X8 X9 X10 X11         
   END                                                 
 WHEN X1 >< "ARC0518I" THEN DO                         
   OUT.J = ROHIT NOT STARTED X6 X7 X8 X9 X10 X11       
   END                                                 
 WHEN X1 >< "ARC0720I" THEN DO                         
    OUT.J = SINGH NOT STARTED X6 X7 X8 X9 X10 X11   
    END                                             
  WHEN X1 >< "ARC0721I" THEN DO                     
    OUT.J = SATHISH NOT STARTED X6 X7 X8 X9 X10 X11
    END                                             
  WHEN X1 >< "ARC0699I" THEN DO                     
    OUT.J = GANDE NOT STARTED X6 X7 X8 X9 X10 X11   
    END                                             
  WHEN X1 >< "ARC0680I" THEN DO                     
    OUT.J = KUMAR NOT STARTED X6 X7 X8 X9 X10 X11   
    END                                             
  WHEN X1 >< "ARC0681I" THEN DO                     
    OUT.J = PS NOT STARTED X6 X7 X8 X9 X10 X11     
    END                                         
   OTHERWISE     
   DO             
   OUT.J = ALL     
   J=J+1           
   END             
   END   


Please ignore the messages I have put in OUT.J in every step.
ravisankarc
 
Posts: 47
Joined: Thu Aug 27, 2009 2:18 am
Has thanked: 0 time
Been thanked: 0 time

Re: How to fetch data from PS file

Postby enrico-sorichetti » Wed Jan 11, 2012 8:10 pm

if You want good help start using the code tags..
we spend time understanding and providing solutions to TS problems
we do not like to waste time trying to understand a badly formatted post
so we expect the TS be able to post <data> and <code> in a readable format

what happened when You tried to run the code You posted ?
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: How to fetch data from PS file

Postby Akatsukami » Wed Jan 11, 2012 8:23 pm

ravisankarc wrote:I am sorry, I didn't understand what do you mean by tags...

When you compose a reply (even as I do now), you will see to the right of the edit box a field of smilie graphics and, immediately below them, the comment BBCode is ON. Click on the blue letters to review the BBCode tags available, including the Code tag.

As the first executable line in your exec, add a TRACE instruction; use either 'I' or 'R' as the argument. If it is not apparent to you what the defect is, post the output here (in Code tags).
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: How to fetch data from PS file

Postby ravisankarc » Wed Jan 11, 2012 8:42 pm

@ enrico-sorichetti :

When I tried with the code I have posted then it is giving the last record of my input ie., :

ARC0621I HSM VOLUME DUMP ENDED 29 Dec 2011 01:07:39
ravisankarc
 
Posts: 47
Joined: Thu Aug 27, 2009 2:18 am
Has thanked: 0 time
Been thanked: 0 time

Re: How to fetch data from PS file

Postby dick scherrer » Thu Jan 12, 2012 1:31 am

Hello,

I didn't understand what do you mean by tags...
Review the REXX you posted - it has been "Code'd".
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: How to fetch data from PS file

Postby expat » Thu Jan 12, 2012 1:57 pm

You must have more resource than sense to run EXPIREBV on a daily basis.
expat
 
Posts: 459
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 8 times

Re: How to fetch data from PS file

Postby Pedro » Thu Jan 12, 2012 8:31 pm

Checking if something is not there is a little different than checking if it is there.

I think you need to define a flag for each thing you are looking for, initialized as off. As you scan your file, turn on the flag for the ones you find. When you are done reading your file, examine the flags and issue a message for the ones that are still turned off.
Pedro Vera
User avatar
Pedro
 
Posts: 686
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: How to fetch data from PS file

Postby ravisankarc » Fri Jan 13, 2012 7:40 pm

Yes, it's true that checking something when it is not there is very difficult. Could you please tell me how to use flags..
ravisankarc
 
Posts: 47
Joined: Thu Aug 27, 2009 2:18 am
Has thanked: 0 time
Been thanked: 0 time

Next

Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post