David:

        OK, here it is; it's not pretty (I wrote the code as one of my first 
PIPES experiments many years ago), but it does exactly what you want it to do. 
The syntax is: QDA DA xxxx*  where xxxx is from 1 to 6 characters of the 
volumes you are looking for (generic) followed by a "*".

        The reason that I used files instead of stems is because, way back 
then, many users didn't have enough CMS storage to handle large stems in Rexx.

        Try it out, do with it what you desire, and enjoy. BTW, make certain 
the vertical bars & the logical not sign translate correctly when you cut & 
paste.

David Wakser


/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*                                                             */
/*     This EXEC was designed to replace the normal QUERY      */
/*     NAMES function to suppress the display of the VM        */
/*     MAGIC dummy entries shown. It looks for "¢" as the      */
/*     first character and suppresses the display of that      */
/*     name; all other invocations of the QUERY command are    */
/*     passed right on to CP/CMS.                              */
/*                                                             */
/*                                DMW   08/03/94               */
/*                                                             */
/*     Modified May 3, 1998 to process a generic "Q DA"        */
/*                          command. Format "QDA DA SYS*"      */
/*                          will show all DASD beginning       */
/*                          with "SYS" - even if "FREE"        */
/*                                DMW   08/03/94               */
/*                                                             */
/*     Modified July 1 2009 to process DASD names more proper- */
/*                          ly and to remove the Q NAMES part  */
/*                          since is was only valuable         */
/*                          when VM Magic was used.    dmw     */
/*                                                             */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
a1  = ""
a2  = ""
a3  = ""
a4  = ""
a5  = ""
a6  = ""
a7  = ""
a8  = ""
a9  = ""
a10 = ""
a11 = ""
arg a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 .
if a1 ¬= "DA" then
    do
       "QUERY" a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11
       exit
    end
if a1 = "DA" then
   do
      found = 0
      found = pos("*",a2)
      if found ¬= 0 then signal LIST_DISKS
        /*     Otherwise pass command directly to QUERY      */
      "QUERY" a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11
      exit
   end
LIST_DISKS:

"pipe CP Q DA",
   "| specs 21.6 1",
   "| > AA1 AA1 A"

disk_packs = translate(a2,' ','*')
disk_packs = strip(disk_packs,'B',' ')
search_size = length(disk_packs)
start_col = ""
if search_size = 1 then start_col = 1
if substr(a2,1,1) ¬= "*" then start_col = "1-" || search_size
"pipe < AA1 AA1 A",
   "| locate " || start_col || " /" || disk_packs || "/ | specs 1-6 | > AA2 AA2 
A"

"pipe CP Q DA FREE | > AA3 AA3 A"
"pipe < AA3 AA3 A",
   "| specs 11.6 1 write 31.6 1 write 51.6 1 write 71.6 1 write | > AA4 AA4 A"

"pipe < AA4 AA4 A",
   "| locate " || start_col || "  /" || disk_packs || "/",
   "| >> AA2 AA2 A"

"ERASE AA1 AA1 A"
"ERASE AA3 AA3 A"
"ERASE AA4 AA4 A"

"pipe < AA2 AA2 A | specs 1.6 | stem xx."
"CLRSCRN"
if xx.0 = "XX.0" | xx.0 = "" then
   do
      say " "
      say "      No DASD with characters"  disk_packs "exists."
      say " "
      exit
   end

say " "
say "             A total of" xx.0 "disks will be displayed."
say " "
do i = 1 to xx.0
  "pipe CP Q DA" xx.i "| CONSOLE"
end
say " "
say "        A total of" xx.0 "disks were displayed."
say " "
"ERASE AA2 AA2 A"
Exit


******************************************************************************


-----Original Message-----
From: The IBM z/VM Operating System [mailto:[email protected]] On Behalf 
Of Dean, David (I/S)
Sent: Wednesday, July 01, 2009 5:07 PM
To: [email protected]
Subject: Re: CP Query wildcards

Wow, thanks to all for the help!!

David Dean
Information Systems
*bcbstauthorized*

-----Original Message-----
From: The IBM z/VM Operating System [mailto:[email protected]] On Behalf 
Of Richard Troth
Sent: Wednesday, July 01, 2009 3:33 PM
To: [email protected]
Subject: Re: CP Query wildcards

By the way ... Unix cheats.
The shell expands all wildcards, which I have always said is a mistake because 
it presumes on the context.  The shell can only expand wildcards that are 
filenames.  Not everything you might want to wildcard is a file.  Wouldn't it 
be nice if you could  'ifconfig eth*'?


It's just an observation, not a rant against Unix.
Actually, I LIKE Unix and wish we all made more use of OpenVM.


So ... to make 'q dasd' work the way David expresses, that function would need 
to call some kind of globbing subfunction.  Same thing for 'ifconfig' in Linux 
and Unix.  We need normalized namespace globbing, something which can be used 
by commands which don't necessarily do files, commands which are part of 
non-Unix stuff (like the CP Nuc).
This stuff has been implemented in C time and again.  Too bad CP
doesn't have a C runtime instantiated.  Oh ... wait ... It does!   :-)


And now back to your regularly scheduled list traffic.


-- R;   <><





On Wed, Jul 1, 2009 at 11:58, Dean, David (I/S)<[email protected]>
wrote:
> Why won't my wildcard work?
>
>
>
>
>
> q dasd l53701
>
> DASD C018 CP SYSTEM L53701   1
>
> DASD C0CE CP SYSTEM L53701   1
>
> DASD C0CF CP SYSTEM L53701   1
>
>
>
> CP
>
> q dasd l53*
>
> DASD L53* was not found.
>
>
>
>
>
> Thanks
>
>
>
> David Dean
>
> Information Systems
>
> *bcbstauthorized*
>
>
>
> -----------------------------------------------------
> Please see the following link for the BlueCross BlueShield of
Tennessee
> E-mail disclaimer:  http://www.bcbst.com/email_disclaimer.shtm
>

-----------------------------------------------------
Please see the following link for the BlueCross BlueShield of Tennessee E-mail 
disclaimer:  http://www.bcbst.com/email_disclaimer.shtm

Confidentiality Note: This e-mail, including any attachment to it, may contain 
material that is confidential, proprietary, privileged and/or "Protected Health 
Information," within the meaning of the regulations under the Health Insurance 
Portability & Accountability Act as amended.  If it is not clear that you are 
the intended recipient, you are hereby notified that you have received this 
transmittal in error, and any review, dissemination, distribution or copying of 
this e-mail, including any attachment to it, is strictly prohibited. If you 
have received this e-mail in error, please immediately return it to the sender 
and delete it from your system. Thank you.

Reply via email to