IDENTIFICATIONDIVISION. PROGRAM-ID. CBLPARC3. AUTHOR. SIMOTIME ENTERPRISES. ***************************************************************** * Copyright (C) 1987-2005 SimoTime Enterprises, LLC. * * * * All rights reserved. Unpublished, all rights reserved under * * copyright law and international treaty. Use of a copyright * * notice is precautionary only and does not imply publication * * or disclosure. * * * * Permission to use, copy, modify and distribute this software * * for any non-commercial purpose and without fee is hereby * * granted, provided the SimoTime copyright notice appear on all * * copies of the software. The SimoTime name or Logo may not be * * used in any advertising or publicity pertaining to the use * * of the software without the written permission of SimoTime * * Enterprises. * * * * Permission to use, copy, modify and distribute this software * * for any commercial purpose requires a fee to be paid to * * SimoTime Enterprises. Once the fee is received by SimoTime * * the latest version of the software will be delivered and a * * license will be granted for use within an enterprise, * * provided the SimoTime copyright notice appear on all copies * * of the software. The SimoTime name or Logo may not be used * * in any advertising or publicity pertaining to the use of the * * software without the written permission of SimoTime * * Enterprises. * * * * SimoTime Enterprises makes no warranty or representations * * about the suitability of the software for any purpose. It is * * provided "AS IS" without any express or implied warranty, * * including the implied warranties of merchantability, fitness * * for a particular purpose and non-infringement. SimoTime * * Enterprises shall not be liable for any direct, indirect, * * special or consequential damages resulting from the loss of * * use, data or projects, whether in an action of contract or * * tort, arising out of or in connection with the use or * * performance of this software * * * * SimoTime Enterprises * * 15 Carnoustie Drive * * Novato, CA 94949-5849 * * 415.883.6565 * * * * RESTRICTED RIGHTS LEGEND * * Use, duplication, or disclosure by the Government is subject * * to restrictions as set forth in subparagraph (c)(1)(ii) of * * the Rights in Technical Data and Computer Software clause at * * DFARS 52.227-7013 or subparagraphs (c)(1) and (2) of * * Commercial Computer Software - Restricted Rights at 48 * * CFR 52.227-19, as applicable. Contact SimoTime Enterprises, * * 15 Carnoustie Drive, Novato, CA 94949-5849. * * * ***************************************************************** * This program is provided by SimoTime Enterprises * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * * * ***************************************************************** * ***************************************************************** * Source Member: CBLPARC3.CBL ***************************************************************** * * CBLPARC3 - This program will process a SYSIN parameter. * * CALLING PROTOCOL * ---------------- * USE STANDARD PROCEDURE TO EXECUTE, RUN OR ANIMATE. * * DESCRIPTION * ----------- * This program will process the JCL parameter from SYSIN. * * //SYSIN DD * * Parameter from SYSIN... * //* * * or a DUMMY is required to avoid an ABEND on the ACCEPT... * * //SYSIN DD DUMMY * * This program will simply display the text string. * **************************************************************** * * MAINTENANCE * ----------- * 1997/02/27 Simmons, Created program. * ***************************************************************** * DATADIVISION. WORKING-STORAGESECTION. * ***************************************************************** * Data-structure for Title and Copyright... * ------------------------------------------------------------
01 SIM-TITLE.
05 T1 pic X(11) value'* CBLPARC3 '.
05 T2 pic X(34) value'Sample, Process SYSIN Parameter '.
05 T3 pic X(10) value' v03.12.02'.
05 T4 pic X(24) value' http://www.simotime.com'.
01 SIM-COPYRIGHT.
05 C1 pic X(11) value'* CBLPARC3 '.
05 C2 pic X(20) value'Copyright 1987-2005 '.
05 C3 pic X(28) value' SimoTime Enterprises, LLC '.
05 C4 pic X(20) value' All Rights Reserved'.
01 SIM-THANKS-01.
05 C1 pic X(11) value'* CBLPARC3 '.
05 C2 pic X(32) value'Thank you for using this sample '.
05 C3 pic X(32) value'by SimoTime Enterprises, LLC '.
05 C4 pic X(04) value' '.
***************************************************************** PROCEDUREDIVISION. if FIRST-TIME not = 'N' perform Z-POST-COPYRIGHT move'N'to FIRST-TIME end-if
perform 4 times moveSPACESto SYSIN-PARAMETER *! A DD statement is required or a hard ABEND will occur *! on the ACCEPT. If no parameters are passed then a *! //SYSIN DD DUMMY is required to prevent the COBOL *! program from ABENDING on the ACCEPT ... from SYSIN. *! Since there is no File Status code for the accept then *! an ACCEPT after the final record is read from SYSIN *! will leave the buffer in the state before the request. *! In this example the buffer is always initialized with *! space characters and the logic in the program will *! determine a ZERO record length and the routine should *! stop accepting (or reading) from SYSIN. The following *! example intentionally reads (or accepts) beyond the *! SYSIN records available to show a technique for *! handling this possibility. accept SYSIN-PARAMETER from SYSIN subtract SYSIN-LENGTH from SYSIN-LENGTH if SYSIN-PARAMETER = SPACES add SYSIN-LENGTH toZEROgiving JCL-PARM-LENGTH move MESSAGE-TEXT-01 to MESSAGE-TEXT perform Z-POST-MESSAGE else perform CALCULATE-TEXT-LENGTH add SYSIN-LENGTH toZEROgiving JCL-PARM-LENGTH move MESSAGE-TEXT-01 to MESSAGE-TEXT perform Z-POST-MESSAGE move SYSIN-PARAMETER to MESSAGE-TEXT perform Z-POST-MESSAGE end-if end-perform
perform Z-THANK-YOU.
GOBACK.
*****************************************************************
CALCULATE-TEXT-LENGTH. add 1 toZEROgiving IX-1 inspect SYSIN-PARAMETER replacingall LOW-VALUES bySPACES perform 80 times if SYSIN-PARAMETER(IX-1:1) not = SPACE add IX-1 toZEROgiving SYSIN-LENGTH end-if add 1 to IX-1 end-perform exit.
***************************************************************** * Display Copyright or Program Messages... *****************************************************************
Z-POST-COPYRIGHT. display SIM-TITLE upon console display SIM-COPYRIGHT upon console exit.
*****************************************************************
Z-POST-MESSAGE. display MESSAGE-BUFFER upon console moveSPACESto MESSAGE-TEXT exit.
*****************************************************************
Z-THANK-YOU. display SIM-THANKS-01 upon console display SIM-THANKS-02 upon console exit. ***************************************************************** * This example is provided by SimoTime Enterprises * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * *****************************************************************
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.