The Virtualization Cookbook for SLES 10 SP2 - z/VM - IBM
The Virtualization Cookbook for SLES 10 SP2 - z/VM - IBM
The Virtualization Cookbook for SLES 10 SP2 - z/VM - IBM
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
B.2 z/<strong>VM</strong> REXX EXECs and XEDIT macros<br />
This section lists three z/<strong>VM</strong> REXX EXECs, one XEDIT macro and a sample parameter file.<br />
B.2.1 <strong>The</strong> CPFORMAT EXEC<br />
Following is the code <strong>for</strong> the EXEC that <strong>for</strong>mats multiple disks using CPFMTXA (described in<br />
section 4.6.1, “Formatting the paging volumes” on page 47):<br />
/*+------------------------------------------------------------------+*/<br />
/*| EXEC: CPFORMAT - wrapper around CPFMTXA to <strong>for</strong>mat many DASD |*/<br />
/*| retVal: 0 - success |*/<br />
/*| 1 - help was asked <strong>for</strong> or given |*/<br />
/*| 2 - user is not sure |*/<br />
/*| 3 - DASD (minidisk) range is not valid |*/<br />
/*| 4 - at least one DASD (minidisk) is reserved to MAINT |*/<br />
/*+------------------------------------------------------------------+*/<br />
/* For details on how this EXEC is used, see one of the two books:<br />
"z/<strong>VM</strong> and Linux on <strong>IBM</strong> System z: <strong>The</strong> <strong>Virtualization</strong> <strong>Cookbook</strong> <strong>for</strong> <strong>SLES</strong> 11 SP1"<br />
on the Web at: http://www.redbooks.ibm.com/abstracts/SG247493.html<br />
-or-<br />
"z/<strong>VM</strong> and Linux on <strong>IBM</strong> System z: <strong>The</strong> <strong>Virtualization</strong> <strong>Cookbook</strong> <strong>for</strong> RHEL 6"<br />
on the Web at: http://www.redbooks.ibm.com/abstracts/SG247492.html */<br />
/*------------------------------------------------------------------<br />
THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR<br />
CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT<br />
LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,<br />
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.<br />
NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR<br />
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL<br />
DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED<br />
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,<br />
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF<br />
THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS<br />
GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES<br />
-------------------------------------------------------------------*/<br />
firstChar = 'U' /* change this <strong>for</strong> an LPAR ID other than 'U' */<br />
parse upper arg dasds "AS " type<br />
if ((dasds = '') | (dasds = '?')) then call help<br />
labelPrefix = getLabelPrefix(firstChar type)<br />
numDasd = parseDasd(dasds)<br />
answer = areYouSure(type)<br />
if (answer = 'Y') then /* the user is sure */<br />
do<br />
<strong>for</strong>matted = ""<br />
retVal = doFormat(labelPrefix numDasd type)<br />
call doReport retVal<br />
end<br />
else<br />
retVal = 2<br />
exit retVal<br />
/*+------------------------------------------------------------------+*/<br />
help: procedure expose firstChar<br />
/*+------------------------------------------------------------------+*/<br />
parse source . . fn .<br />
say ''<br />
say 'Synopsis:'<br />
244 <strong>The</strong> <strong>Virtualization</strong> <strong>Cookbook</strong> <strong>for</strong> RHEL 6