Count number of volume and cylinders of each DASD



IBM's Command List programming language & Restructured Extended Executor

Count number of volume and cylinders of each DASD

Postby xboss » Thu Dec 20, 2012 12:52 pm

I am trying to list the total number of volumes and total amount of cylinders for each unique Dev-Serial using REXX. So far my rexx code and outcome
000001 /* REXX */                                                           
000002                                                                     
000003   "EXECIO * DISKR IN (stem p. FINIS"                                 
000004     say 'Number of input records is' p.0                             
000005     LastRec = p.0                                                   
000006                                                                     
000007 /*************************************************/                 
000008                                                                     
000009  Do rec=1 to p.0                                                     
000010    IF POS('IEE459I',p.rec) > 0 then call report /* call subroutine */
000011  END                                                                 
000012                                                                     
000013                                                                     
000014  "EXECIO 0 DISKR IN (FINIS"                             
000015  "EXECIO 0 DISKW OUT (FINIS"                           
000016  "free file(in)"                                       
000017  "free file(out)"                                       
000018 /**************************************************/   
000019 Exit 0                                                 
000020 /**************************************************/   
000021                                                         
000022 report:                                                 
000023      i = 1                                               
000024    DO FOREVER                                             
000025    rec = rec + 1                                         
000026      IF POS('DEV-SERIAL',p.rec) > 0 then iterate         
000027      IF POS('****',p.rec) > 0 then LEAVE                 
000028      serial.i = WORD(p.rec,8)    /*  Dev-Serial Number */
000029      cylinder.i = WORD(p.rec,5)    /*  Each Cylinders */ 
000030      cylinder.i = strip(cylinder.i,'T','*')               
000043      info = serial.i cylinder.i   
000044      i = i + 1                     
000045      say info                     
000046      w.1 = INFO                   
000047      "EXECIO 1 DISKW OUT (stem w."
000048    END                             
000049 return                                                         


The output of the program above is
0113-23040 600
0113-23040 600
0175-W4941 1668
0113-23040 250
0175-W4941 1200
0175-W4941 1200

But I am looking for a summary of above like
DEV-SERIAL VOLUMES CYL
0113-23040 3 1450
0175-W4941 3 4068

I tried nested loop but no success, any direction or pseudo code would be appreciable.
xboss
 
Posts: 79
Joined: Mon Nov 29, 2010 10:55 am
Has thanked: 0 time
Been thanked: 0 time

Re: Count number of volume and cylinders of each DASD

Postby enrico-sorichetti » Thu Dec 20, 2012 7:22 pm

if You tell what You are trying to achieve You might receive better suggestions

from the confusing info provided
<Count number of volume and cylinders of each DASD

there are zillions of easier ways to find out about the cylinder stuff
( device capacity,used,free,largest,fragmentation index, ... )
look at the ISMF volume dialog
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: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Count number of volume and cylinders of each DASD

Postby xboss » Thu Dec 20, 2012 9:51 pm

Enrico, I have a requirement to accomplish with my REXX code. Reason for providing that subject, I was trying to being transparent regarding where these data came from. I hope I have mentioned clearly what am I expecting my REXX code to do here. Thank you for the feedback.
xboss
 
Posts: 79
Joined: Mon Nov 29, 2010 10:55 am
Has thanked: 0 time
Been thanked: 0 time

Re: Count number of volume and cylinders of each DASD

Postby halfteck » Thu Dec 20, 2012 10:22 pm

Forgive me, but as enrico says there are better ways of achieving your result than with REXX, you should explore them.
Why the insistence on using REXX?
Also your REXX code is somewhat inefficient, you are writing out EXECIO DISKW when you could QUEUE the result and write them all at the end, using QUEUED().
halfteck
 
Posts: 42
Joined: Tue Nov 08, 2011 8:47 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Count number of volume and cylinders of each DASD

Postby dick scherrer » Thu Dec 20, 2012 11:00 pm

Hello,

The requirement should be for obtaining the needed output. The "requirement" should not dictate the method.

Requirements should be based on business or technical need rather than the whim of some senior (or heaven forbid - some user) . . .
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: Count number of volume and cylinders of each DASD

Postby Akatsukami » Thu Dec 20, 2012 11:02 pm

xboss wrote:Enrico, I have a requirement to accomplish with my REXX code.

This is ambiguous. Do you mean, "I have a requirement, which I am attempting to fulfill with this Rexx script", or "I have a requirement to use Rexx in accomplishing this task"? The advice that you receive is dependent on the meaning.
"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: Count number of volume and cylinders of each DASD

Postby xboss » Thu Dec 20, 2012 11:20 pm

Yes I have a requirement to use REXX in accomplishing this task.
xboss
 
Posts: 79
Joined: Mon Nov 29, 2010 10:55 am
Has thanked: 0 time
Been thanked: 0 time

Re: Count number of volume and cylinders of each DASD

Postby Akatsukami » Thu Dec 20, 2012 11:33 pm

xboss wrote:Yes I have a requirement to use REXX in accomplishing this task.

Well, as you have been told, Rexx is a poor tool to use in this task, and, if your words have any weight in your shop, you should certainly confront the person who thought (I use the word loosely, of course) of this piece of blatant stupidity.

However, to fulfill the task in Rexx, the records should be sorted on dev-serial, then for like dev-serials the number of compound variables with like values counted and the cylinders summed. On a dev-serial break, the variables are then written.
"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: Count number of volume and cylinders of each DASD

Postby dick scherrer » Fri Dec 21, 2012 12:36 am

Hello,

Yes I have a requirement to use REXX in accomplishing this task.
You may not want to reply, but who/why determined rexx was part of the requirement?

Or is it possible that you requested this be a "requirement" so you could learn more?
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: Count number of volume and cylinders of each DASD

Postby xboss » Fri Dec 21, 2012 12:53 am

Dick Scherrer,
Yes, both. Since there involves around 190 records, so its been decided REXX is the one. And this project won't end here. Definitely, as a beginner I was to learn coding as much as possible and I find practicing is the best way to do it.
xboss
 
Posts: 79
Joined: Mon Nov 29, 2010 10:55 am
Has thanked: 0 time
Been thanked: 0 time

Next

Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post