Hi folks,
I just noticed the "Page size when compiling printer files" thread and I
thought, that my STRPREPRC (Start Pre-Processor) utility might be helpful
here. I developed the STRPREPRC utility years ago, when we started using
TurnOver, because I did not like the idea to let TurnOver store all the
object specific variations of the CRT* commands under the cover. I wanted
to see the parameters that must be changed for certain objects. And I
wanted the changed parameters go into the source archive.
The utility can be used in two ways. Either it takes the complete CRT*
command from the source member or it uses a basic CRT*, which has been
specified at the command prompt. In both cases it adds and overrides those
parameters that it finds in the ">>COMPILE<<" or ">>LINK<<" sections of the
source header.
I use the utility for all object types and, as shown below, I have source
code for all kind of objects, e.g. data areas.
With the last enhancement of the command I added the ability to create an
EVFEVENT file from the job log, which is nice for non-source objects or
when there is a problem with the ">>PRE-COMPILER<<" header. I turned it on
for all object types and the STRPREPRC utility automatically turns it off
when it finds the "*EVENTF" string in the object creation command.
See the examples below.
Feel free to download the utility from here (bottom of the page):
http://tools400.de/English/Freeware/Utilities/utilities.html
Thomas.
For example, that is how I create a printer file (member type PRTF):
*-----------------------------------------------------------
* STRPREPRC Compile Options:
* >>PRE-COMPILER<<
* >>CRTCMD<< CRTPRTF FILE(&LI/&OB) +
* SRCFILE(&SL/&SF) SRCMBR(&SM);
* >>COMPILE<<
* >>PARM<< PAGESIZE(70 80);
* >>PARM<< CPI(10);
* >>PARM<< LPI(6);
* >>PARM<< OVRFLW(62);
* >>PARM<< USRDTA('portrait');
* >>END-COMPILE<<
* >>EXECUTE<<
* >>END-PRE-COMPILER<<
*-----------------------------------------------------------
And here is how I create a service program (member type MAKSRV):
/*--------------------------------------------------
/* STRPREPRC Compile Options:
/* >>PRE-COMPILER<<
/* >>CRTCMD<< CRTSRVPGM SRVPGM(&LI/&OB);
/* >>COMPILE<<
/* >>PARM<< EXPORT(*SRCFILE);
/* >>PARM<< SRCFILE(&SL/&SF) SRCMBR(&SM);
/* >>PARM<< BNDSRVPGM((&LI/NBRRNG *IMMED));
/* >>PARM<< ACTGRP(ISPHERE);
/* >>PARM<< TGTRLS(&TR);
/* >>PARM<< MODULE(&LI/SPLF);
/* >>PARM<< DETAIL(*BASIC);
/* >>PARM<< TEXT('Spooled Files');
/* >>END-COMPILE<<
/* >>EXECUTE<<
/* >>END-PRE-COMPILER<<
/*--------------------------------------------------
STRPGMEXP
EXPORT SYMBOL('SPLF_PREPARE')
EXPORT SYMBOL('SPLF_SETJOB')
EXPORT SYMBOL('SPLF_SETUSER')
EXPORT SYMBOL('SPLF_SETFORMTYPE')
EXPORT SYMBOL('SPLF_SETOUTPUTQUEUE')
EXPORT SYMBOL('SPLF_SETUSERDATA')
EXPORT SYMBOL('SPLF_SETDATETIME')
EXPORT SYMBOL('SPLF_BUILD')
EXPORT SYMBOL('SPLF_CLEAR')
ENDPGMEXP
That is how to create a program (member type MAKPGM):
/*--------------------------------------------------
/* >>PRE-COMPILER<<
/* >>CRTCMD<< CRTPGM PGM(&LI/WSDL2RVC);
/* >>LINK<<
/* >>PARM<< MODULE(&LI/WSDL2V01 +
/* &LI/WSDL2R68 +
/* &LI/WSDL2R69 +
/* &LI/WSDL2R71 +
/* &LI/WSDL2R80 +
/* &LI/WSDL2R88 +
/* &LI/WSDL2R90 +
/* &LI/LOG4RPG00 +
/* );
/* >>PARM<< USRPRF(*USER);
/* >>PARM<< ACTGRP(*NEW );
/* >>PARM<< ENTMOD(&LI/WSDL2V01);
/* >>PARM<< BNDSRVPGM(BASICS1 +
/* IFS +
/* HTTPAPIR4 );
/* >>PARM<< BNDDIR(QC2LE );
/* >>PARM<< TGTRLS(V6R1M0 );
/* >>PARM<< DETAIL(*BASIC);
/* >>END-LINK<<
/* >>EXECUTE<<
/* >>END-PRE-COMPILER<<
/*--------------------------------------------------
Last but not least, this his how I create a data area (member type CLP):
/*-----------------------------------------------------------------------*/
/* */
/* Copyright (c) 2012-2014 iSphere Project Owners */
/* All rights reserved. This program and the accompanying materials */
/* are made available under the terms of the Common Public License v1.0 */
/* which accompanies this distribution, and is available at */
/*
http://www.eclipse.org/legal/cpl-v10.html */
/* */
/*-----------------------------------------------------------------------*/
/* */
/* iSphere Version */
/* */
/*-----------------------------------------------------------------------*/
/* STRPREPRC Compile Options: */
/* >>PRE-COMPILER<< */
/* >>CRTCMD<< CRTCLPGM PGM(QTEMP/&OB) + */
/* SRCFILE(&SL/&SF) SRCMBR(&SM); */
/* >>COMPILE<< */
/* >>PARM<< TEXT('Creates: iSphere Version Data Area'); */
/* >>END-COMPILE<< */
/* >>EXECUTE<< */
/* >>CMD<< CALL PGM(QTEMP/&OB) PARM(&LI &OB); */
/* >>END-PRE-COMPILER<< */
/*-----------------------------------------------------------------------*/
PGM PARM(&LIB &OBJ)
DCL VAR(&LIB ) TYPE(*CHAR) LEN(10)
DCL VAR(&OBJ ) TYPE(*CHAR) LEN(10)
DCL VAR(&VER_SERVER ) TYPE(*CHAR) LEN(6) VALUE('020000')
DCL VAR(&VER_CLIENT ) TYPE(*CHAR) LEN(6) VALUE('020000')
/* ------------------------- Error handler --------------------- */
DCL VAR(&ERRMSGKEY ) TYPE(*CHAR) LEN( 4)
DCL VAR(&ERRMSGTYPE) TYPE(*CHAR) LEN(10) VALUE('*DIAG')
DCL VAR(&ERRNUMTYPE) TYPE(*CHAR) LEN( 4) VALUE(x'00000001')
DCL VAR(&ERRSTKE ) TYPE(*CHAR) LEN(10) VALUE('*PGMBDY')
DCL VAR(&ERRSTKCNT ) TYPE(*CHAR) LEN( 4) VALUE(x'00000001')
DCL VAR(&ERRCODE ) TYPE(*CHAR) LEN( 8) +
VALUE(x'0000000000000000')
MONMSG MSGID(CPF0000) EXEC(GOTO ERRHDLR)
/* ------------------------------------------------------------- */
DLTDTAARA DTAARA(&LIB/&OBJ)
MONMSG MSGID(CPF2105) EXEC(DO)
RMVMSG PGMQ(*SAME (*)) CLEAR(*ALL)
ENDDO
CRTDTAARA DTAARA(&LIB/&OBJ) TYPE(*CHAR) LEN(256) TEXT('iSphere +
Version')
CHGDTAARA DTAARA(&LIB/&OBJ ( 1 7)) VALUE('Server:')
CHGDTAARA DTAARA(&LIB/&OBJ (15 7)) VALUE('Client:')
CHGDTAARA DTAARA(&LIB/&OBJ ( 8 6)) VALUE(&VER_SERVER)
CHGDTAARA DTAARA(&LIB/&OBJ (22 6)) VALUE(&VER_CLIENT)
RETURN
/* --------------------------------------------------- */
/* Error Handler */
/* --------------------------------------------------- */
ERRHDLR:
CALL PGM(QMHMOVPM) PARM(&ERRMSGKEY &ERRMSGTYPE &ERRNUMTYPE +
&ERRSTKE &ERRSTKCNT &ERRCODE )
MONMSG MSGID(CPF0000)
CALL PGM(QMHRSNEM) PARM(&ERRMSGKEY &ERRCODE )
ENDPGM
As an Amazon Associate we earn from qualifying purchases.