Page 1 of 2

How to fetch data from PS file

PostPosted: Wed Jan 11, 2012 6:50 pm
by ravisankarc
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

Re: How to fetch data from PS file

PostPosted: Wed Jan 11, 2012 6:59 pm
by BillyBoyo
Can you show us the code you have an the output which indicates that it is not working. In the Code tags, please.

Re: How to fetch data from PS file

PostPosted: Wed Jan 11, 2012 7:39 pm
by ravisankarc
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.

Re: How to fetch data from PS file

PostPosted: Wed Jan 11, 2012 8:10 pm
by enrico-sorichetti
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 ?

Re: How to fetch data from PS file

PostPosted: Wed Jan 11, 2012 8:23 pm
by Akatsukami
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).

Re: How to fetch data from PS file

PostPosted: Wed Jan 11, 2012 8:42 pm
by ravisankarc
@ 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

Re: How to fetch data from PS file

PostPosted: Thu Jan 12, 2012 1:31 am
by dick scherrer
Hello,

I didn't understand what do you mean by tags...
Review the REXX you posted - it has been "Code'd".

Re: How to fetch data from PS file

PostPosted: Thu Jan 12, 2012 1:57 pm
by expat
You must have more resource than sense to run EXPIREBV on a daily basis.

Re: How to fetch data from PS file

PostPosted: Thu Jan 12, 2012 8:31 pm
by Pedro
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.

Re: How to fetch data from PS file

PostPosted: Fri Jan 13, 2012 7:40 pm
by ravisankarc
Yes, it's true that checking something when it is not there is very difficult. Could you please tell me how to use flags..