Write to a LOG File A COBOL Program Example |
The SimoTime Home Page |
This suite of sample programs describes how to write a message or text string to a user-defined log file. The file has variable length records based on the size of the text string.
We have made a significant effort to ensure the documents and software technologies are correct and accurate. We reserve the right to make changes without notice at any time. The function delivered in this version is based upon the enhancement requests from a specific group of users. The intent is to provide changes as the need arises and in a timeframe that is dependent upon the availability of resources.
Copyright © 1987-2025
SimoTime Technologies and Services
All Rights Reserved
WIP2
The following diagram shows the data and logic flow for posting a message with a maximum length of 1024 bytes to a user-defined log file.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Note-1 SYSLOG is a sequential file with variable length records (4-1055). The maximum record length provides for a 1024 byte user buffer preceded by a date/time stamp. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Post a Message to a User-Defined Log File |
The following diagram shows the data and logic flow for posting a message with a maximum length of 32760 bytes to a user-defined log file.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Note-1 SYSPROBE is a sequential file with variable length records (4-32760). The maximum record length provides for a 32760 byte user buffer. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Post a Message to a User-Defined Log File |
This section describes the batch job scripts used to demonstrate how the messages are written to the user-defined log files. The job scripts provided are Windows CMD Files and JCL Members for a Mainframe System.
The following CMD Files are intended to be used on a Windows System with Micro Focus COBOL.
The following CMD File (CBLLOGW1.cmd) is used to execute a COBOL program that writes a user-defined message (or text string) to a log file.
@echo OFF rem * ******************************************************************* rem * CBLLOGW1.CMD - a Windows Command File * rem * This program is provided by SimoTime Technologies * rem * (C) Copyright 1987-2019 All Rights Reserved * rem * Web Site URL: http://www.simotime.com * rem * e-mail: helpdesk@simotime.com * rem * ******************************************************************* rem * rem * Text - Display a Message or Write to a LOG File rem * Author - SimoTime Technologies rem * Date - November 11, 2003 rem * Version - 06.07.16 rem * rem * This set of programs illustrate the use a COBOL program to DISPLAY rem * a message to the console and/or WRITE a message to a file. rem * rem * The log file is a sequential file with variable length records. rem * The record structure contains a date/time stamp followed by a user rem * message. The user message has a maximum length of 1024 bytes. rem * rem * This technique provides for the use of a single COBOL source rem * program that will run on OS/390, Windows or UNIX. rem * rem * This set of programs will run on a Personal Computer with Windows rem * and Micro Focus Net Express. rem * rem * ************ rem * * CBLLOGW1 * rem * ********cmd* rem * * rem * ************ ************ rem * * call ******* ENV1BASE * rem * ************ ********cmd* rem * * rem * * rem * ************ ************ rem * * run ******* CBLLOGC1 * rem * ************ ********cbl* rem * * * rem * * * rem * * ************ ************ rem * * * SIMOLOGS ******* SYSLOG * rem * * ********cbl* * *******file* rem * ************ * rem * * EOJ * * ************ rem * ************ **** CONSOLE * rem * ************ rem * ******************************************************************** rem * Step 1 of 2 Set the global environment variables... rem * setlocal set CmdName=CBLLOGW1 call ..\ENV1BASE %CmdName% set JobStatus=0000 if "%SYSLOG%" == "" set syslog=c:\SimoLIBR\LOGS\SimoTime.LOG rem * call SimoNOTE "*******************************************************%CmdName%" call SimoNOTE "Starting CmdName %CmdName%, V09.05.22, User is %USERNAME%" call SimoNOTE "SYSLOG is %SYSLOG%" rem * ******************************************************************** rem * Step 2 of 2 Execute the sample program... rem * run CBLLOGC1 if not "%ERRORLEVEL%" == "0" set JobStatus=0010 if not "%JobStatus%" == "0000" goto :EojNOK :EojAOK call SimoNOTE "Finished CmdName %CmdName%, Job Status is %JobStatus% " goto :End :EojNOK call SimoNOTE "ABENDING CmdName %CmdName%, Job Status is %JobStatus% " echo CBLLOGC1 is ABENDING>>%BaseLib1%\LOGS\ABENDLOG.TXT goto :End :End call SimoNOTE "Conclude SysLog is %SYSLOG%" if not "%1" == "nopause" pause endlocal
The following CMD File (CBLLOGW2.cmd) is used to execute a COBOL program that writes a user-defined message (or text string) to a log file.
@echo OFF rem * ******************************************************************* rem * CBLLOGW2.CMD - a Windows Command File * rem * This program is provided by SimoTime Technologies * rem * (C) Copyright 1987-2019 All Rights Reserved * rem * Web Site URL: http://www.simotime.com * rem * e-mail: helpdesk@simotime.com * rem * ******************************************************************* rem * rem * Text - Display a Message or Write to a LOG File rem * Author - SimoTime Technologies rem * Date - November 11, 2003 rem * Version - 06.07.16 rem * rem * This set of programs illustrate the use a COBOL program to DISPLAY rem * a message to the console and/or WRITE a message to a file. rem * rem * The log file is a sequential file with variable length records. rem * The record structure provides for a user message that has a maximum rem * length of 32760 bytes. rem * rem * This technique provides for the use of a single COBOL source rem * program that will run on OS/390, Windows or UNIX. rem * rem * This set of programs will run on a Personal Computer with Windows rem * and Micro Focus Net Express. rem * rem * ************ rem * * CBLLOGW2 * rem * ********cmd* rem * * rem * ************ ************ rem * * call ******* ENV1BASE * rem * ************ ********cmd* rem * * rem * * rem * ************ ************ rem * * run ******* CBLLOGC2 * rem * ************ ********cbl* rem * * * rem * * * rem * * ************ ************ rem * * * SIMOV32K ******* SYSPROBE * rem * * ********cbl* * *******file* rem * ************ * rem * * EOJ * * ************ rem * ************ **** CONSOLE * rem * ************ rem * ******************************************************************** rem * Step 1 of 2 Set the global environment variables... rem * setlocal set CmdName=CBLLOGW2 call ..\ENV1BASE %CmdName% set JobStatus=0000 if "%SYSPROBE%" == "" set SYSPROBE=%BASELIB1%\SYS1\LOGS\SIMOTIME.SYSPROBE.%CMDNAME%.DAT rem * call SimoNOTE "*******************************************************%CmdName%" call SimoNOTE "Starting CmdName %CmdName%, V09.05.22, User is %USERNAME%" call SimoNOTE "SYSPROBE is %SYSPROBE%" rem * ******************************************************************** rem * Step 2 of 2 Execute the sample program... rem * run CBLLOGC2 if not "%ERRORLEVEL%" == "0" set JobStatus=0010 if not "%JobStatus%" == "0000" goto :EojNOK :EojAOK call SimoNOTE "Finished CmdName %CmdName%, Job Status is %JobStatus% " goto :End :EojNOK call SimoNOTE "ABENDING CmdName %CmdName%, Job Status is %JobStatus% " echo %CmdName% is ABENDING>>%BaseLib1%\LOGS\ABENDLOG.TXT goto :End :End call SimoNOTE "Conclude SYSPROBE is %SYSPROBE%" if not "%1" == "nopause" pause endlocal
The following JCL Members are intended to be used on a ZOS Mainframe or a Linux, UNIX or Windows System with Micro Focus Enterprise Server.
The following JCL Member (CBLLOGJ1.jcl) is used to execute a COBOL program that writes a user-defined message (or text string) to a log file.
//CBLLOGJ1 JOB SIMOTIME,ACCOUNT,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1 //* ******************************************************************* //* CBLLOGJ1.JCL - a JCL Member for Batch Job Processing * //* This JCL Member is provided by SimoTime Technologies * //* (C) Copyright 1987-2019 All Rights Reserved * //* Web Site URL: http://www.simotime.com * //* e-mail: helpdesk@simotime.com * //* ******************************************************************* //* //* Text - Display a Message or Write to a LOG File //* Author - SimoTime Technologies //* Date - November 11, 2003 //* Version - 06.07.16 //* //* This set of programs illustrate the use a COBOL program to DISPLAY //* a message to the console and/or WRITE a message to a file. //* //* The log file is a sequential file with variable length records. //* The record structure contains a date/time stamp followed by a user //* message. The user message has a maximum length of 1024 bytes. //* //* The DD statement for SYSOUT is required by this example. The //* COBOL program may be compiled using the SYSOUT directive and //* without the DD statement for SYSOUT an RTS173 or RTS227 may occur. //* //* This set of programs will run on a mainframe under MVS or on //* a Personal Computer running Windows and Mainframe Express by //* Micro Focus. //* //* ************ //* * CBLLOGJ1 * //* ********jcl* //* * //* * //* ************ ************ ************ //* * EXEC PGM ******* CBLLOGC1 ******* SYSOUT * //* ************ ********cbl* ************ //* * * //* * * //* * ************ ************ //* * * SIMOLOGS ******* SYSLOG * //* * ********cbl* * *******file* //* ************ * //* * EOJ * * ************ //* ************ **** CONSOLE * //* ************ //* //* ******************************************************************* //* Step 1 of 3, Delete the previously created SYSLOG file. //SYSLOGDT EXEC PGM=IEFBR14 //SYSLOG DD DSN=SIMOTIME.UTIL.CBLLOGD1,DISP=(MOD,DELETE,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=V,LRECL=1055,DSORG=PS) //* //* ******************************************************************* //* Step 2 of 3, Allocate a new SYSLOG file. //* Note: The LRECL is four (4) bytes bigger than the logical record //* that is defined in the program that writes to SYSLOG. This //* allows for the four (4) byte Record Descriptor Word (RDW) //* that is appended to the front of each record. The program //* defines the records as varying in size from 64 to 1,051. //* Note: It is necessary to pre-allocate the SYSLOG file. The program //* that does the actual file compare will do an "OPEN EXTEND". //* If the file is not pre-allocated, an open error will be //* posted and the program will execute but will only display //* truncated information to SYSOUT. //SYSLOGCT EXEC PGM=IEFBR14 //SYSLOG DD DSN=SIMOTIME.UTIL.CBLLOGD1,DISP=(NEW,CATLG,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=V,LRECL=1055,DSORG=PS) //* //* //* ******************************************************************* //* Step 3 of 3, This is a single step job. //* //CBLLOGS1 EXEC PGM=CBLLOGC1 //STEPLIB DD DSN=SIMOTIME.DEMO.LOADLIB1,DISP=SHR //SYSLOG DD DSN=SIMOTIME.UTIL.CBLLOGD1,DISP=(OLD,KEEP,KEEP), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=V,LRECL=1055,DSORG=PS) //SYSOUT DD SYSOUT=* //*
The following JCL Member (CBLLOGJ2.jcl) is used to execute a COBOL program that writes a user-defined message (or text string) to a log file.
//CBLLOGJ2 JOB SIMOTIME,ACCOUNT,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1 //* ******************************************************************* //* CBLLOGJ2.JCL - a JCL Member for Batch Job Processing * //* This JCL Member is provided by SimoTime Technologies * //* (C) Copyright 1987-2019 All Rights Reserved * //* Web Site URL: http://www.simotime.com * //* e-mail: helpdesk@simotime.com * //* ******************************************************************* //* //* Text - Display a Message or Write to a LOG File //* Author - SimoTime Technologies //* Date - November 11, 2003 //* Version - 06.07.16 //* //* This set of programs illustrate the use a COBOL program to DISPLAY //* a message to the console and/or WRITE a message to a file. //* //* The log file is a sequential file with variable length records. //* The record structure contains a date/time stamp followed by a user //* message. The user message has a maximum length of 1024 bytes. //* //* The DD statement for SYSOUT is required by this example. The //* COBOL program may be compiled using the SYSOUT directive and //* without the DD statement for SYSOUT an RTS173 or RTS227 may occur. //* //* This set of programs will run on a mainframe under MVS or on //* a Personal Computer running Windows and Mainframe Express by //* Micro Focus. //* //* ************ //* * CBLLOGJ2 * //* ********jcl* //* * //* * //* ************ ************ ************ //* * EXEC PGM ******* CBLLOGC2 ******* SYSOUT * //* ************ ********cbl* ************ //* * * //* * * //* * ************ ************ //* * * SIMOV32K ******* SYSLOG * //* * ********cbl* * *******file* //* ************ * //* * EOJ * * ************ //* ************ **** CONSOLE * //* ************ //* //* ******************************************************************* //* Step 1 of 3, Delete the previously created SYSLOG file. //SYSLOGDT EXEC PGM=IEFBR14 //SYSPROBE DD DSN=SIMOTIME.SYSPROBE.CBLLOGD2,DISP=(MOD,DELETE,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=V,LRECL=32760,DSORG=PS) //* //* ******************************************************************* //* Step 2 of 3, Allocate a new SYSLOG file. //* Note: The LRECL is four (4) bytes bigger than the logical record //* that is defined in the program that writes to SYSLOG. This //* allows for the four (4) byte Record Descriptor Word (RDW) //* that is appended to the front of each record. The program //* defines the records as varying in size from 64 to 1,051. //* Note: It is necessary to pre-allocate the SYSLOG file. The program //* that does the actual file compare will do an "OPEN EXTEND". //* If the file is not pre-allocated, an open error will be //* posted and the program will execute but will only display //* truncated information to SYSOUT. //SYSLOGCT EXEC PGM=IEFBR14 //SYSPROBE DD DSN=SIMOTIME.SYSPROBE.CBLLOGD2,DISP=(NEW,CATLG,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=V,LRECL=32760,DSORG=PS) //* //* //* ******************************************************************* //* Step 3 of 3, This is a single step job. //* //CBLLOGS1 EXEC PGM=CBLLOGC2 //STEPLIB DD DSN=SIMOTIME.DEMO.LOADLIB1,DISP=SHR //SYSPROBE DD DSN=SIMOTIME.SYSPROBE.CBLLOGD2,DISP=(OLD,KEEP,KEEP), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=V,LRECL=32760,DSORG=PS) //SYSOUT DD SYSOUT=* //*
WIP1
The following source member (CBLLOGC1.cbl) is a COBOL program that writes a user-defined message (or text string) to a log file.
WIP2
IDENTIFICATION DIVISION. PROGRAM-ID. CBLLOGC1. AUTHOR. SIMOTIME TECHNOLOGIES. ***************************************************************** * Copyright (C) 1987-2019 SimoTime Technologies. * * * * 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 * * Technologies. * * * * Permission to use, copy, modify and distribute this software * * for any commercial purpose requires a fee to be paid to * * SimoTime Technologies. 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 * * Technologies. * * * * SimoTime Technologies makes no warranty or representations * * about the suitability of the software for any purpose. It is * * provided "AS IS" without any expressed or implied warranty, * * including the implied warranties of merchantability, fitness * * for a particular purpose and non-infringement. SimoTime * * Technologies 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 Technologies * * 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 Technologies, * * 15 Carnoustie Drive, Novato, CA 94949-5849. * * * ***************************************************************** * This program is provided by SimoTime Technologies * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * ***************************************************************** * ***************************************************************** * Source Member: CBLLOGC1.CBL * Copy Files: PASSLOGS.CPY * Calls to: SIMOLOGS ***************************************************************** * * CBLLOGC1 - Call SIMOLOGS to display a message upon the console * and/or write to a used-defined file. * * CALLING PROTOCOL * ---------------- * Use standard procedure to RUN or ANIMATE. * * DESCRIPTION * ----------- * This program will call a COBOL routine to display a message * upon the console and/or write to a used-defined file. * * ************ * * CBLLOGJ1 * * ********jcl* * * * * * ************ * * CBLLOGC1 *--* * ********cbl* * * * * * * * * * * ************ ************ * * *--* SIMOLOGS *--*--* CONSOLE * * * ********cbl* * ******dsply* * * * * ************ * ************ * * EOJ * *--* SYSLOG * * ************ *******file* * * This program calls SIMOLOGS to perform two functions: * * DISPLAY - display a message upon the console. * FILE - write a message to a used-defined file. * ***************************************************************** * The EXPAND function will do the following: * * Input: BTS-PASS-BITS, a one byte field (8-bits) * OUTPUT: BTS-PASS-BYTES, an eight byte field * * For each bit that is on in the BTS-PASS-BITS field set the * corresponding byte in the BTS-PASS-BYTES field to a value * of one. * * For each bit that is off in the BTS-PASS-BITS field set the * corresponding byte in the BTS-PASS- * BYTES field to a value of zero. * * Example: if BTS-PASS-BITS = x'55' * then BTS-PASS-BYTES will be '01010101' * ***************************************************************** * * MAINTENANCE * ----------- * 1989/02/27 Simmons, Created program. * 1997/03/17 Simmons, Updated for call to SIMOLOGS. * ***************************************************************** * ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. ***************************************************************** * Data-structure for Title and Copyright... * ------------------------------------------------------------ 01 SIM-TITLE. 05 T1 pic X(11) value '* CBLLOGC1 '. 05 T2 pic X(34) value 'Post a Message to DISPLAY or FILE '. 05 T3 pic X(10) value ' v09.05.27'. 05 T4 pic X(24) value ' http://www.simotime.com'. 01 SIM-COPYRIGHT. 05 C1 pic X(11) value '* CBLLOGC1 '. 05 C2 pic X(20) value 'Copyright 1987-2019 '. 05 C3 pic X(28) value ' SimoTime Technologies '. 05 C4 pic X(20) value ' All Rights Reserved'. 01 SIM-THANKS-01. 05 C1 pic X(11) value '* CBLLOGC1 '. 05 C2 pic X(32) value 'Thank you for using this program'. 05 C3 pic X(32) value ' provided from SimoTime Technolo'. 05 C4 pic X(04) value 'gies'. 01 SIM-THANKS-02. 05 C1 pic X(11) value '* CBLLOGC1 '. 05 C2 pic X(32) value 'Please send all inquires or sugg'. 05 C3 pic X(32) value 'estions to the helpdesk@simotime'. 05 C4 pic X(04) value '.com'. COPY PASSLOGS. ***************************************************************** * Buffer used for posting messages to the SYSOUT device. * ------------------------------------------------------------ 01 MESSAGE-BUFFER. 05 MESSAGE-HEADER pic X(11) value '* CBLLOGC1 '. 05 MESSAGE-TEXT pic X(68). ***************************************************************** PROCEDURE DIVISION. perform Z-POST-COPYRIGHT perform DISPLAY-MESSAGE-TO-CONSOLE perform WRITE-MESSAGE-TO-FILE perform POST-MESSAGE-TO-BOTH. perform Z-THANK-YOU. move ZERO to RETURN-CODE GOBACK. ***************************************************************** DISPLAY-MESSAGE-TO-CONSOLE. move 'OPR1' to SIMOLOGS-REQUEST move ZERO to SIMOLOGS-STATUS move '* CBLLOGC1 Message 001...' to SIMOLOGS-MESSAGE call 'SIMOLOGS' using SIMOLOGS-PASS-AREA move '* CBLLOGC1 Message 002...' to SIMOLOGS-MESSAGE call 'SIMOLOGS' using SIMOLOGS-PASS-AREA exit. ***************************************************************** WRITE-MESSAGE-TO-FILE. move 'LOG1' to SIMOLOGS-REQUEST move ZERO to SIMOLOGS-STATUS move '* CBLLOGC1 Message 001...' to SIMOLOGS-MESSAGE call 'SIMOLOGS' using SIMOLOGS-PASS-AREA move '* CBLLOGC1 Message 002...' to SIMOLOGS-MESSAGE call 'SIMOLOGS' using SIMOLOGS-PASS-AREA exit. ***************************************************************** POST-MESSAGE-TO-BOTH. move 'OPR2' to SIMOLOGS-REQUEST move ZERO to SIMOLOGS-STATUS move '* CBLLOGC1 Message 003...' to SIMOLOGS-MESSAGE call 'SIMOLOGS' using SIMOLOGS-PASS-AREA exit. ***************************************************************** * The following Z-Routines perform administrative tasks * * for this program. * ***************************************************************** ***************************************************************** Z-POST-COPYRIGHT. display SIM-TITLE display SIM-COPYRIGHT exit. ***************************************************************** Z-POST-MESSAGE. display MESSAGE-BUFFER move SPACES to MESSAGE-TEXT exit. ***************************************************************** Z-THANK-YOU. display SIM-THANKS-01 display SIM-THANKS-02 exit. ***************************************************************** * This example is provided by SimoTime Technologies * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * *****************************************************************
The following source member (CBLLOGC2.cbl) is a COBOL program that writes a user-defined message (or text string) to a log file.
WIP2
IDENTIFICATION DIVISION. PROGRAM-ID. CBLLOGC2. AUTHOR. SIMOTIME TECHNOLOGIES. ***************************************************************** * Copyright (C) 1987-2019 SimoTime Technologies. * * * * 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 * * Technologies. * * * * Permission to use, copy, modify and distribute this software * * for any commercial purpose requires a fee to be paid to * * SimoTime Technologies. 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 * * Technologies. * * * * SimoTime Technologies makes no warranty or representations * * about the suitability of the software for any purpose. It is * * provided "AS IS" without any expressed or implied warranty, * * including the implied warranties of merchantability, fitness * * for a particular purpose and non-infringement. SimoTime * * Technologies 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 Technologies * * 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 Technologies, * * 15 Carnoustie Drive, Novato, CA 94949-5849. * * * ***************************************************************** * This program is provided by SimoTime Technologies * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * ***************************************************************** * ***************************************************************** * Source Member: CBLLOGC2.CBL * Copy Files: PASSLOGS.CPY * Calls to: SIMOLOGS ***************************************************************** * * CBLLOGC1 - Call SIMOLOGS to display a message upon the console * and/or write to a used-defined file. * * CALLING PROTOCOL * ---------------- * Use standard procedure to RUN or ANIMATE. * * DESCRIPTION * ----------- * This program will call a COBOL routine to display a message * upon the console and/or write to a used-defined file. * * ************ * * CBLLOGJ2 * * ********jcl* * * * * * ************ * * CBLLOGC2 *--* * ********cbl* * * * * * * * * * * ************ ************ * * *--* SIMOV32K *--*--* CONSOLE * * * ********cbl* * ******dsply* * * * * ************ * ************ * * EOJ * *--* SYSLOG * * ************ *******file* * * This program calls SIMOLOGS to perform two functions: * * DISPLAY - display a message upon the console. * FILE - write a message to a used-defined file. * ***************************************************************** * The EXPAND function will do the following: * * Input: BTS-PASS-BITS, a one byte field (8-bits) * OUTPUT: BTS-PASS-BYTES, an eight byte field * * For each bit that is on in the BTS-PASS-BITS field set the * corresponding byte in the BTS-PASS-BYTES field to a value * of one. * * For each bit that is off in the BTS-PASS-BITS field set the * corresponding byte in the BTS-PASS- * BYTES field to a value of zero. * * Example: if BTS-PASS-BITS = x'55' * then BTS-PASS-BYTES will be '01010101' * ***************************************************************** * * MAINTENANCE * ----------- * 1989/02/27 Simmons, Created program. * 1997/03/17 Simmons, Updated for call to SIMOV32K. * ***************************************************************** * ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. ***************************************************************** * Data-structure for Title and Copyright... * ------------------------------------------------------------ 01 SIM-TITLE. 05 T1 pic X(11) value '* CBLLOGC2 '. 05 T2 pic X(34) value 'Post a Message to DISPLAY or FILE '. 05 T3 pic X(10) value ' v09.05.27'. 05 T4 pic X(24) value ' http://www.simotime.com'. 01 SIM-COPYRIGHT. 05 C1 pic X(11) value '* CBLLOGC2 '. 05 C2 pic X(20) value 'Copyright 1987-2019 '. 05 C3 pic X(28) value ' SimoTime Technologies '. 05 C4 pic X(20) value ' All Rights Reserved'. 01 SIM-THANKS-01. 05 C1 pic X(11) value '* CBLLOGC2 '. 05 C2 pic X(32) value 'Thank you for using this program'. 05 C3 pic X(32) value ' provided from SimoTime Technolo'. 05 C4 pic X(04) value 'gies'. 01 SIM-THANKS-02. 05 C1 pic X(11) value '* CBLLOGC2 '. 05 C2 pic X(32) value 'Please send all inquires or sugg'. 05 C3 pic X(32) value 'estions to the helpdesk@simotime'. 05 C4 pic X(04) value '.com'. COPY PASSV32K. ***************************************************************** * Buffer used for posting messages to the SYSOUT device. * ------------------------------------------------------------ 01 MESSAGE-BUFFER. 05 MESSAGE-HEADER pic X(11) value '* CBLLOGC2 '. 05 MESSAGE-TEXT pic X(68). ***************************************************************** PROCEDURE DIVISION. perform Z-POST-COPYRIGHT * perform DISPLAY-MESSAGE-TO-CONSOLE perform WRITE-MESSAGE-TO-FILE perform DUMP-MESSAGE-TO-FILE * perform POST-MESSAGE-TO-BOTH. perform Z-THANK-YOU. move ZERO to RETURN-CODE GOBACK. ***************************************************************** DISPLAY-MESSAGE-TO-CONSOLE. move 'OPR1' to SIMOV32K-REQUEST move ZERO to SIMOV32K-STATUS move '* CBLLOGC2 Message 001...' to SIMOV32K-MESSAGE call 'SIMOV32K' using SIMOV32K-PASS-AREA move '* CBLLOGC2 Message 002...' to SIMOV32K-MESSAGE call 'SIMOV32K' using SIMOV32K-PASS-AREA exit. ***************************************************************** DUMP-MESSAGE-TO-FILE. move 'DUMP' to SIMOV32K-REQUEST move ZERO to SIMOV32K-STATUS move '* CBLLOGC2 Message 003...' to SIMOV32K-MESSAGE call 'SIMOV32K' using SIMOV32K-PASS-AREA SIMOV32K-MESSAGE exit. ***************************************************************** WRITE-MESSAGE-TO-FILE. move 'POST' to SIMOV32K-REQUEST move ZERO to SIMOV32K-STATUS move '* CBLLOGC2 Message 001...' to SIMOV32K-MESSAGE call 'SIMOV32K' using SIMOV32K-PASS-AREA SIMOV32K-MESSAGE move '* CBLLOGC2 Message 002...' to SIMOV32K-MESSAGE call 'SIMOV32K' using SIMOV32K-PASS-AREA SIMOV32K-MESSAGE exit. ***************************************************************** POST-MESSAGE-TO-BOTH. move 'OPR2' to SIMOV32K-REQUEST move ZERO to SIMOV32K-STATUS move '* CBLLOGC2 Message 003...' to SIMOV32K-MESSAGE call 'SIMOV32K' using SIMOV32K-PASS-AREA exit. ***************************************************************** * The following Z-Routines perform administrative tasks * * for this program. * ***************************************************************** ***************************************************************** Z-POST-COPYRIGHT. display SIM-TITLE display SIM-COPYRIGHT exit. ***************************************************************** Z-POST-MESSAGE. display MESSAGE-BUFFER move SPACES to MESSAGE-TEXT exit. ***************************************************************** Z-THANK-YOU. display SIM-THANKS-01 display SIM-THANKS-02 exit. ***************************************************************** * This example is provided by SimoTime Technologies * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * *****************************************************************
WIP1
WIP2
WIP1
WIP2
WIP3
WIP4
WIP5
This suite of sample programs describes how to write a message or text string to a user-defined log file. This document may be used as a tutorial for new programmers or as a quick reference for experienced programmers.
In the world of programming there are many ways to solve a problem. This documentation and software were developed and tested on systems that are configured for a SIMOTIME environment based on the hardware, operating systems, user requirements and security requirements. Therefore, adjustments may be needed to execute the jobs and programs when transferred to a system of a different architecture or configuration.
SIMOTIME Services has experience in moving or sharing data or application processing across a variety of systems. For additional information about SIMOTIME Services or Technologies please contact us using the information in the Contact or Feedback section of this document.
Software Agreement and Disclaimer
Permission to use, copy, modify and distribute this software, documentation or training material for any purpose requires a fee to be paid to SimoTime Technologies. Once the fee is received by SimoTime the latest version of the software, documentation or training material 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 Technologies.
SimoTime Technologies makes no warranty or representations about the suitability of the software, documentation or learning material for any purpose. It is provided "AS IS" without any expressed or implied warranty, including the implied warranties of merchantability, fitness for a particular purpose and non-infringement. SimoTime Technologies 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, documentation or training material.
This section includes links to documents with additional information that are beyond the scope and purpose of this document. The first group of documents may be available from a local system or via an internet connection, the second group of documents will require an internet connection.
Note: A SimoTime License is required for the items to be made available on a local system or server.
The following links may be to the current server or to the Internet.
Note: The latest versions of the SimoTime Documents and Program Suites are available on the Internet and may be accessed using the icon. If a user has a SimoTime Enterprise License the Documents and Program Suites may be available on a local server and accessed using the icon.
Explore An Enterprise System Model that describes and demonstrates how Applications that were running on a Mainframe System and non-relational data that was located on the Mainframe System were copied and deployed in a Microsoft Windows environment with Micro Focus Enterprise Server.
Explore the COBOL Connection for more examples of COBOL programming techniques and sample code.
Explore an Extended List of Software Technologies that are available for review and evaluation. The software technologies (or Z-Packs) provide individual programming examples, documentation and test data files in a single package. The Z-Packs are usually in zip format to reduce the amount of time to download.
Explore The ASCII and EBCDIC Translation Tables. These tables are provided for individuals that need to better understand the bit structures and differences of the encoding formats.
Explore The File Status Return Codes that are used to interpret the results of accessing VSAM data sets and/or QSAM files.
The following links will require an internet connection.
This suite of programs and documentation is available for download. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.
A good place to start is The SimoTime Home Page for access to white papers, program examples and product information. This link requires an Internet Connection
Explore The Micro Focus Web Site for more information about products (including Micro Focus COBOL) and services available from Micro Focus. This link requires an Internet Connection.
Explore the Glossary of Terms for a list of terms and definitions used in this suite of documents and white papers.
This document was created and is maintained by SimoTime Technologies. If you have any questions, suggestions, comments or feedback please use the following contact information.
1. | Send an e-mail to our helpdesk. |
1.1. | helpdesk@simotime.com. |
2. | Our telephone numbers are as follows. |
2.1. | 1 415 763-9430 office-helpdesk |
2.2. | 1 415 827-7045 mobile |
We appreciate hearing from you.
SimoTime Technologies was founded in 1987 and is a privately owned company. We specialize in the creation and deployment of business applications using new or existing technologies and services. We have a team of individuals that understand the broad range of technologies being used in today's environments. Our customers include small businesses using Internet technologies to corporations using very large mainframe systems.
Quite often, to reach larger markets or provide a higher level of service to existing customers it requires the newer Internet technologies to work in a complementary manner with existing corporate mainframe systems. We specialize in preparing applications and the associated data that are currently residing on a single platform to be distributed across a variety of platforms.
Preparing the application programs will require the transfer of source members that will be compiled and deployed on the target platform. The data will need to be transferred between the systems and may need to be converted and validated at various stages within the process. SimoTime has the technology, services and experience to assist in the application and data management tasks involved with doing business in a multi-system environment.
Whether you want to use the Internet to expand into new market segments or as a delivery vehicle for existing business functions simply give us a call or check the web site at http://www.simotime.com
Return-to-Top |
Write to a LOG File using COBOL |
Copyright © 1987-2025 SimoTime Technologies and Services All Rights Reserved |
When technology complements business |
http://www.simotime.com |