Count number of volume and cylinders of each DASD



IBM's Command List programming language & Restructured Extended Executor

Re: Count number of volume and cylinders of each DASD

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

Thanks for the reply - yup, practice IS the best way :)

Good luck, someone will be here when there are questions.

d
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 enrico-sorichetti » Fri Dec 21, 2012 2:47 am

Mr xboss instead of the condescending reply did You care to try to understand my reply ???
looks like not :evil:

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.

horse manure

the requirement is to provide results...

and seemed clear that I did not question REXX usage but the source of the info

since we reply on our own time, free of charge and we share experience
we provide solutions according to out best judgement and best practices
if You want poor solutions based on poor requirements and poor analysis hire a paid consultant
who for the proper fee will work with a RNoN to give You the replies You expect :mrgreen:
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 enrico-sorichetti » Fri Dec 21, 2012 3:53 am

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().


I beg to disagree, or better REXX disagrees

using queue results in a double data movement
queue ==> <write> to the stack
execio ==> <read> from the stack, <write> to the file


here is the result of my tests from best to worst

1) EXECIO the stem with all the records
2) QUEUE all RECORDS / execio

3) EXECIO each record
4) QUEUE & EXECIO each record

all the test were run writing 100000 records

case 1 fill the stem, one execio for the whole stem
000008 /* REXX */
000009 parse arg  imax
000010 zi =  time()
000011 ze =  time("e")
000012 buff.0 = 1
000013 buff.1 = "some data"
000014 do i = 1 to imax
000015     buff.i = "some data"
000016 end
000017 address tso "execio " imax " diskw outfile (stem BUFF."
000018 say "started" zi
000019 say "ended  " time()
000020 say "elaps  " time("e")
000021 exit


HTRT05I ------------------------------------------------------------------------
        - Step Termination Statistics                                          -
        -                                                                      -
        - Program Name       IKJEFT01                          hh:mm:ss.th     -
        - Step Name          IKJ               Elapsed Time          16.71     -
        - Procedure Step                       TCB CPU Time          14.79     -
        - Return Code              00          SRB CPU Time          00.01     -
        - Total I/O               327          Total CPU Time        14.80     -
        - Service Units          636K                                          -
        -                                                                      -
        - Region Size           1024K          Pages Paged               0     -
        - Data/Hiperspace          0M          Pages Swapped             0     -
        - ASID Swaps                0          Pages Stolen              0     -
        -                                      VIO (In and Out)          1     -
        -                                                                      -
        - --------Below 16Meg--------          --------Above 16Meg--------     -
        - Private Area          9192K          Private Area       1801216K     -
        - Max Allocated          204K          Max Allocated         5572K     -
        - LSQA And SWA           348K          LSQA And SWA         10972K     -
        -                                                                      -
        - DDName    Unit    Blksize       I/O                                  -
        - SYSEXEC   VIO       27920         2                                  -
        - *System*                        325                                  -
        -                                                                      -
        ------------------------------------------------------------------------

started 00:04:28
ended   00:04:43
elaps   14.179206


case 2 ) queue all the records, one execio for all the records queued
000008 /* REXX */
000009 parse arg  imax
000010 zi =  time()
000011 ze =  time("e")
000012 buff.0 = 1
000013 buff.1 = "some data"
000014 do i = 1 to imax
000015     queue buff.1
000016 end
000017 address tso "execio * diskw outfile "
000018 say "started" zi
000019 say "ended  " time()
000020 say "elaps  " time("e")
000021 exit


HTRT05I ------------------------------------------------------------------------
        - Step Termination Statistics                                          -
        -                                                                      -
        - Program Name       IKJEFT01                          hh:mm:ss.th     -
        - Step Name          IKJ               Elapsed Time          27.01     -
        - Procedure Step                       TCB CPU Time          24.15     -
        - Return Code              00          SRB CPU Time          00.01     -
        - Total I/O               328          Total CPU Time        24.16     -
        - Service Units         1038K                                          -
        -                                                                      -
        - Region Size           1024K          Pages Paged               0     -
        - Data/Hiperspace          0M          Pages Swapped             0     -
        - ASID Swaps                0          Pages Stolen              0     -
        -                                      VIO (In and Out)          1     -
        -                                                                      -
        - --------Below 16Meg--------          --------Above 16Meg--------     -
        - Private Area          9192K          Private Area       1801216K     -
        - Max Allocated          204K          Max Allocated         5572K     -
        - LSQA And SWA           348K          LSQA And SWA         11048K     -
        -                                                                      -
        - DDName    Unit    Blksize       I/O                                  -
        - SYSEXEC   VIO       27920         2                                  -
        - *System*                        326                                  -
        -                                                                      -
        ------------------------------------------------------------------------
       
started 00:04:00
ended   00:04:27
elaps   26.768784


case 3 one execio for each record
000008 /* REXX */
000009 parse arg  imax
000010 zi =  time()
000011 ze =  time("e")
000012 buff.0 = 1
000013 buff.1 = "some data"
000014 do i = 1 to imax
000015     address tso "execio 1 diskw outfile (stem buff."
000016 end
000017 say "started" zi
000018 say "ended  " time()
000019 say "elaps  " time("e")
000020 exit


HTRT05I ------------------------------------------------------------------------
        - Step Termination Statistics                                          -
        -                                                                      -
        - Program Name       IKJEFT01                          hh:mm:ss.th     -
        - Step Name          IKJ               Elapsed Time          49.95     -
        - Procedure Step                       TCB CPU Time          45.44     -
        - Return Code              00          SRB CPU Time          00.01     -
        - Total I/O               327          Total CPU Time        45.45     -
        - Service Units         1954K                                          -
        -                                                                      -
        - Region Size           1024K          Pages Paged               0     -
        - Data/Hiperspace          0M          Pages Swapped             0     -
        - ASID Swaps                0          Pages Stolen              0     -
        -                                      VIO (In and Out)          1     -
        -                                                                      -
        - --------Below 16Meg--------          --------Above 16Meg--------     -
        - Private Area          9192K          Private Area       1801216K     -
        - Max Allocated          204K          Max Allocated          360K     -
        - LSQA And SWA           348K          LSQA And SWA         10972K     -
        -                                                                      -
        - DDName    Unit    Blksize       I/O                                  -
        - SYSEXEC   VIO       27920         2                                  -
        - *System*                        325                                  -
        -                                                                      -
        ------------------------------------------------------------------------
       
started 00:01:11
ended   00:02:00
elaps   49.729041



case 4 ) queue each record, one execio for each record queued
000008 /* REXX */
000009 parse arg  imax
000010 zi =  time()
000011 ze =  time("e")
000012 buff.0 = 1
000013 buff.1 = "some data"
000014 do i = 1 to imax
000015     queue buff.1
000016     address tso "execio * diskw outfile "
000017 end
000018 say "started" zi
000019 say "ended  " time()
000020 say "elaps  " time("e")


HTRT05I ------------------------------------------------------------------------
        - Step Termination Statistics                                          -
        -                                                                      -
        - Program Name       IKJEFT01                          hh:mm:ss.th     -
        - Step Name          IKJ               Elapsed Time       01:19.77     -
        - Procedure Step                       TCB CPU Time       01:11.75     -
        - Return Code              00          SRB CPU Time          00.01     -
        - Total I/O               327          Total CPU Time     01:11.76     -
        - Service Units         3086K                                          -
        -                                                                      -
        - Region Size           1024K          Pages Paged               0     -
        - Data/Hiperspace          0M          Pages Swapped             0     -
        - ASID Swaps                0          Pages Stolen              0     -
        -                                      VIO (In and Out)          1     -
        -                                                                      -
        - --------Below 16Meg--------          --------Above 16Meg--------     -
        - Private Area          9192K          Private Area       1801216K     -
        - Max Allocated          204K          Max Allocated          360K     -
        - LSQA And SWA           348K          LSQA And SWA         10972K     -
        -                                                                      -
        - DDName    Unit    Blksize       I/O                                  -
        - SYSEXEC   VIO       27920         2                                  -
        - *System*                        325                                  -
        -                                                                      -
        ------------------------------------------------------------------------
       
started 00:02:40
ended   00:04:00
elaps   79.552926       
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 enrico-sorichetti » Fri Dec 21, 2012 4:36 pm

even if I am still of the opinion that the approach sucks

here is a snippet on how to handle unknown <keys>
just to show lateral coding techniques :mrgreen:
NOT TO PROVIDE A SOLUTION to the TS

/* rexx */
Trace "O"

res.1 =  "  00- 11.50.38           ds qdasd,aa8,8                                           "
res.2 =  "      11.50.38           IEE459I 11.50.38 DEVSERV QDASD 993                   C   "
res.3 =  "       UNIT VOLSER SCUTYPE DEVTYPE       CYL  SSID SCU-SERIAL DEV-SERIAL EFC      "
res.4 =  "       0AA8 ZSMS00 39900E9 339000A      3339  0AA0 XXZZ-00001 XXYY-00001 *OK      "
res.5 =  "       0AA9 ZSMS01 39900E9 339000A      3339  0AA0 XXZZ-00001 XXYY-00002 *OK      "
res.6 =  "       0AAA ZSMS02 39900E9 339000A      3339  0AA0 XXZZ-00001 XXYY-00002 *OK      "
res.7 =  "       0AAB ZSMS03 39900E9 339000A      3339  0AA0 XXZZ-00001 XXYY-00003 *OK      "
res.8 =  "       0AAC ZSMS04 39900E9 339000A      3339  0AA0 XXZZ-00001 XXYY-00003 *OK      "
res.9 =  "       0AAD ZSMS05 39900E9 339000A      3339  0AA0 XXZZ-00001 XXYY-00003 *OK      "
res.10 = "       0AAE ZSMS06 39900E9 339000A      3339  0AA0 XXZZ-00001 XXYY-00004 *OK      "
res.11 = "       0AAF ZSMS07 39900E9 339000A      3339  0AA0 XXZZ-00001 XXYY-00004 *OK      "
res.12 = "      ****      8 DEVICE(S) MET THE SELECTION CRITERIA                            "
res.13 = "      ****      0 DEVICE(S) FAILED EXTENDED FUNCTION CHECKING                     "
res.0  = 13

f = 0
p = 0
ls = ""
lc = ""
do  r = 1 to res.0

    t = space(res.r)

    if left(t,4) = "****" then ,
        leave r

    if f = 1 then do
        p += 1
        v = strip(word(res.r,8))
        z = translate(v,"__","-*")
        c = strip(word(res.r,5))

        if  symbol( "dev_ser."z ) = "LIT" then do
            interpret "dev_ser."z" = v"
            interpret "dev_cyl."z" = c"
            ls = ls "dev_ser."z
            lc = lc "dev_cyl."z
        end
        else ,
            /* interpret "dev_cyl."z" += c" */
            interpret "dev_cyl."z" = dev_cyl."z" + c"
        /* interpret " say dev_ser."z" dev_cyl."z */

    end

    if  t = space(" UNIT VOLSER SCUTYPE DEVTYPE       CYL  SSID SCU-SERIAL DEV-SERIAL EFC")  then ,
        f = 1

end

k = strip(word(res.r,2))
if  p \= k then ,
    say "count mismatch - processed("p") expected("k")"

do  s = 1 to words(ls)
    say value(word(ls,s)) right(value(word(lc,s)),8)
end

exit


to obtain

XXYY-00001     3339
XXYY-00002     6678
XXYY-00003    10017
XXYY-00004     6678


too bad that TSO rexx needs to handle an auxiliary variable to hold the list of the stem variables used for the the entities processed
OBJECT REXX provides a very smart
do k over stemroot.
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

Previous

Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post