Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Rexx code for Dynamic Checking

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
Fahad

New User


Joined: 30 Jan 2014
Posts: 4
Location: Pune

PostPosted: Thu Jan 30, 2014 4:05 am    Post subject: Rexx code for Dynamic Checking
Reply with quote

Below is the code to check Storage group and this will submit Job to create free space if the free space is less than 45% in Storage group(static).

My requiremnt:- I want dynamic checking. The moment it reaches 45%. It has to submit Job or else It has to check atleast every 30 min of the day(0hr-24hr). Note:-I will Schedule the code to run daily.

Can anyone please advice and correct this code as per my requirement. I am a beginner.

Thanks in advance!!!

Code:
 /*Check Storage group SGTMM and submit migration job if free space is less than 45% */
 mainpara:                                                               
         dd1='PPSG.SGTMM90.MONITOR.OUTPUT'                               
         call init_para dd1                                             
 exit(0)                                                                 
 return;                                                                 
                                                                         
 init_para:                                                             
 PARSE ARG dcolrpt                                                       
       count=1                                                           
        LARGEXT=0                                                       
        "ALLOC DD(INFILE) DSN('"dcolrpt"') SHR"                         
        "EXECIO * DISKR INFILE (STEM RECORD. finis"                     
                                                                         
        IF RC<>0 OR RECORD.0=0 THEN EXIT 13                             
       tot=0                                                           
       DO WHILE COUNT <= RECORD.0                                       
         VOLNAME=SUBSTR(RECORD.count,25,6)                             
         freekb=c2d(SUBSTR(RECORD.count,37,4))                         
         allocated=C2D(SUBSTR(RECORD.count,41,4))                       
         freeperc=(freekb/(freekb+allocated))*100                       
         tot=freeperc + tot                                             
         COUNT=COUNT + 1                                               
       END                                                             
      rows=count-1                                                     
      freeprct=tot/rows                                                 
      if (freeprct < 45) then                                           
      do                                                               
      dsna="'WIP12.JCL.LIB(HHSMDMIG)'"                                 
      address tso                                                       
      "submit" dsna                                                     
      say 'Lesser than 45 and freeprct=' freeprct                       
      end                                                               
      else                                                     
      do                                                       
      say 'Greater than 45 and freeprct=' freeprct             
      end                                                     
      "free dd(INFILE)"                                       
return             


De-Coloured and Code'd
Back to top
View user's profile Send private message

sureshpathi10

Active User


Joined: 03 May 2010
Posts: 154
Location: Kuala Lumpur

PostPosted: Thu Jan 30, 2014 7:17 am    Post subject: Re: Rexx code for Dynamic Checking
Reply with quote

Fahad wrote:
I want dynamic checking. The moment it reaches 45%. It has to submit Job

In this case, your program has to run simultaneously(24/7) to check whether it reaches 45% or not. You may add infinite loop to call to "init_para" in your program to achieve this.

Fahad wrote:
or else It has to check atleast every 30 min of the day(0hr-24hr). Note:-I will Schedule the code to run daily.

why can't you schedule your program to run every 30 mins?
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jan 30, 2014 8:11 am    Post subject:
Reply with quote

Hello,

It is a Very Bad Practice to implement an infinite loop in your process . . .

My clients will not permit this to run on their systems.

As mentioned, you should set this up by the system schedule.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1528
Location: Chennai

PostPosted: Thu Jan 30, 2014 4:45 pm    Post subject:
Reply with quote

Hello Fahad,

Code:
 "ALLOC DD(INFILE) DSN('"dcolrpt"') SHR"


This line in your code possibly says that you are reading a report created from DCOLLECT.
DCOLLECT is a snapshot of system DASD when the DCOLLECT was performed.

So even if you run this REXX 10 times / hour you would be getting the same output, since your input file is static(DCOLLECT)

If you are planning to run it multiple times per day, then you need to run the DCOLLECT job as well multiple times.

My personal opinion is running DCOLLECT once in 30 mins is a bad practice, I guess the DCOLLECT itself would run more than 20 minutes per run.
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2088
Location: Silicon Valley

PostPosted: Thu Jan 30, 2014 8:04 pm    Post subject: Reply to: Rexx code for Dynamic Checking
Reply with quote

Quote:
code to check Storage group

Aren't you trying to replicate some of the function of SMS? To get your %45, can't you just tweak some SMS settings (sorry, I do not know the details).
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts REXX LISTDSI () SMSINFO is not working upendrasri CLIST & REXX 4 Fri Nov 17, 2017 11:33 am
No new posts Calling IKJEFT01 program from Rexx upendrasri CLIST & REXX 4 Wed Nov 15, 2017 4:27 pm
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 5 Wed Oct 04, 2017 6:54 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 47 Fri Sep 29, 2017 1:08 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us