× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I have a Make utility that works with any kind of object with source code that 
I wrote and have been using for twenty years. 

This utility allows you create objects (Programs, Display File, Print Files, 
ILE modules, etc) by simply typing CO in PDM or using Compile in WDSC. 

When you start to do ILE development, this tool becomes absolutely 
essential because you can store how to create modules and how to link together 
modules to create programs or service programs in the source member but as you 
can see below it is handy for everything, especially print files. 

You can download a copy at www.think400.dk/downloads under Compile.

There is a complete write-up in the zip under README.DOC. 

The write-up below is from one done by Scott Klement in Iseries Tech News. 

----------------------------------------------------------------------------------------------------------------------------------------------------

One of the most common things that iSeries developers struggle with is 
remembering the exact procedure required to create objects from source code. 
The various create commands (e.g., CRTBNDxxx, CRTxxxPGM, CRTxxxMOD, CRTDSPF, 
CRTPNLGRP, CRTPF, CRTLF, CRTPRTF, etc.) have lots of options that can be 
specified, and you have to remember to re-specify them if you want to re-create 
the object in the future.

To help solve this problem, Alan Campin created a utility named Compile.

Alan's utility works by reading source members and looking for comments that 
begin with the _> characters. For example, to compile an ILE RPG program, I 
might insert into the program a comment that looks like this:

      *_> CRTBNDRPG PGM(@5/@4) SRCFILE(@2/@1) SRCMBR(@3) DBGVIEW(*LIST)

The Compile utility finds this comment in my program (by looking for the _> 
characters) and runs the CRTBNDRPG command. Wherever you see markers that look 
like "@1", they are replaced by substitution data when the command is run. 
Here's a list of the substitution variables and what they're replaced with:

     @1 = Source file
     @2 = Source file library
     @3 = Source member
     @4 = Compiled object name
     @5 = Compiled object library
     @6 = Optimize (for OPM objects) *YES or *NO
     @7 = Object owner
     @8 = Optimize (for ILE objects) *NONE, *BASIC or *FULL
     @9 = ILE debug view

When the time comes to compile my RPG program (from the preceding example), I 
can run the following command:

COMPILE OBJ(mylib/mypgm) SRCFILE(mylib/QRPGLESRC) SRCMBR(mymbr)

The Compile utility uses the OBJ, SRCFILE, and SRCMBR values that I specify to 
run the CRTBNDRPG command that I put in the program's comments.

You can use the same technique to compile all sorts of different objects. 
Here's sample code that you might insert at the top of the source code for a 
print file. Because the CRTPRTF command has many parameters that you need to 
specify, being able to specify them in the source code is particularly handy:

      *_> DLTF FILE(@5/@4)
      *_> CRTPRTF FILE(@5/@4) SRCFILE(@2/@1) SRCMBR(@3) +
      *_>           PAGESIZE(71 132) LPI(6) CPI(10) +
      *_>           OVRFLW(70) SPOOL(*YES) OUTQ(*JOB) +
      *_>           FORMTYPE(*STD    ) MAXRCDS(*NOMAX) +
      *_>           HOLD(*NO) SAVE(*YES) USRDTA('RUNS_Err')

In this example, the Compile utility first runs the DLTF command to delete the 
print file. It then runs the CRTPRTF command to create the object with 
particular settings.

The ability to specify more than one command is also helpful when you need to 
perform an override before compiling a program. For example:

      *_> CNLLSTSPLF SRCFILE(@2/@1) SRCMBR(@3)
      *_> DLTPGM PGM(@5/@4)
      *_> OVRDBF FILE(FILEXYZ) +
      *_>   TOFILE(LIBABC/FILEABC) +
      *_>   OVRSCOPE(*JOB) +
      *_>   SHARE(*YES) +
      *_>  OPNSCOPE(*JOB)
      *_> CRTRPGPGM  PGM(@5/@4) +
      *_>   SRCFILE(@2/@1) SRCMBR(@3)

This example runs the Cancel Last Spooled File (CNLLSTSPLF) command, which is 
included with the Compile utility, to delete any previous compile listings. It 
then deletes the program object if it already exists, runs the Override with 
Data Base File (OVRDBF) command, and finally compiles the program with the 
Create RPG/400 Program (CRTRPGPGM) command.

Alan's utility works nicely from the command line (as shown here), but it's 
also easy to integrate with both the Programming Development Manager (PDM) and 
WebSphere Development Studio client (WDSc) environments. The utility comes with 
a Microsoft Word document that explains how to use the utility in all these 
environments.




As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.