Re: System/36 sort specs
- From: George Applegate <gappleg8@xxxxxxxxxx>
- Date: Sun, 16 Jul 2006 04:43:55 GMT
Peter,
"Peter Kinsman" <peter@xxxxxxxxxxxxxxxxxxxx> wrote:
I have a client running System/36 code who still groups customers for end-ofCheck out this link for the manual of which I've included the
month reports by long sort specs. In some cases, the same specs are used in
more than one procedure, and in the deepest recesses of my brain, I thought
I had included a procedure within sort specs. I have found uses of // IF
.... GOTO and // TAG statements, but cannot find any includes.
Has anyone else travelled this road please?
following section below:
http://publib.boulder.ibm.com/iseries/v5r2/ic2924/books/c4147310.pdf
You could write a generic sort in a separate procedure, and use those
specs by doing something like the following:
Proc 1 (MAIN):
// ...
// INCLUDE SORT,LIBR FILENAM1,FILENAM2
// LOAD PGM
// FILE NAME-FILE,LABEL-FILENAM2,RETAIN-S
// RUN
(Proc 1 will include and run "SORT" (Proc 2) at the INCLUDE point) -
it is calling proc SORT in library LIBR and is passing parms FILENAM1
and FILENAM2 (allowing you to use the same sort specs for different
files...)
Proc 2 (SORT):
// IF DATAF1-?2? DELETE ?2?,F1 (sorted output file)
// LOAD #GSORT
// FILE NAME-INPUT1,LABEL-?1?,DISP-SHR
// FILE NAME-OUTPUT,LABEL-?2?,DISP-NEW,RECORDS-5000,EXTEND-1000
// RUN
HSORTR
I C 1 6EQC123456
IOC 1 6EQC234567
...
// END
By using the ?1? and ?2? you could use the same sort specs for
different input/output files...
ga
This is the section from the manual above (5-49)
INCLUDE OCL Statement
The INCLUDE OCL statement identifies a procedure member containing OCL
and utility control statements placed into the job stream. If the
procedure is not an MRT procedure, or if you did not specify PDATA-YES
when the procedure member was created, the INCLUDE statement can pass
parameters to the procedure.
If the procedure is a MRT procedure, or if you specified PDATA-YES
when the procedure member was created, the INCLUDE statement can pass
only data to a program.
For general information and programming considerations about MRT
programs and procedures, see the System/36 Environment Programming
book. For information about creating procedures, see Chapter 2,
?Making Your Own Procedures.?
Chapter 5. OCL Statements 5-49
INCLUDE
Use the first form of the INCLUDE statement if the procedure name is
the same as an OCL statement identifier. For example, if the procedure
name is FILE, the following format is correct:
// INCLUDE FILE FILEA,FILEB
Placement: Place the INCLUDE statement anywhere among the OCL
statements.
procedure name ,library name parm1,parm2...
program data
*ALL
Or:
// procedure name ,library name parm1,parm2...
program data
*ALL
Or:
// INCLUDE procedure name ,library name parm1,parm2...
program data
*ALL
S 9020307 - 0
procedure name
This specifies the procedure member called. This procedure must exist
in a source file named QS36PRC, which can be in one of the following:
.. A specified library
.. The current library
.. The system library (#LIBRARY)
.. The library list
library name
This specifies the library searched for the procedure. If you specify
a library name, the search is done in the following order:
1. The library specified
2. #LIBRARY
3. The library list
If you do not enter a library name, the search is done in the
following order:
1. The current library
2. #LIBRARY
3. The library list
parm1,parm2, ...
This specifies parameters for the procedure. You cannot use parameters
if the procedure is an MRT procedure, or if you specified
PDATA-YES when the procedure member was created. The parameters
may or may not be required, depending on the procedure to which
they are passed.
You must not exceed 128 characters in a parameter. You can pass a
maximum of 64 parameters, separated by commas, with an INCLUDE
statement. See ?Procedure Parameters? on page 5-2 for more information
on procedure parameters.
When entering parameters, you can type in up to 512 characters. For
example, you can type in 32 sixteen-character parameters or 64 eight
character parameters. However, the combined total length of all param-
eters cannot exceed 1024 characters. You can accomplish this length
by using substitution expressions and the local data area. See
?Continuing the Lines of a Procedure? on page 2-7 for information
about how to continue entering lines to get more than 120 characters.
program data This specifies data, not parameters, passed at the first
read operation in the program. The data starts with the first nonblank
character following the procedure name and ends with the last nonblank
character in the statement. The data passes to the program at the
first input operation from the display station. (The input record in
the program would contain this data.) Specify up to 508 characters
using continuation. See ?Continuing the Lines of a Procedure? on page
2-7 for information on how to continue entering lines for more than
120 characters.
*ALL This specifies that all 64 parameters pass from the current
procedure level to the procedure called. You can only specify *ALL
within a procedure.
If you specify *ALL as the only parameter and you enter it from
the keyboard or a menu item selects it, an error message appears. If
you specify *ALL as one of the parameters, it is treated as a single
parameter.
Example 1
In the following example, ACCTS and EMPNUM are two parameters
interpreted by the PAYROLL procedure. Parameter 2 is omitted.
PAYROLL ACCTS,,EMPNUM
Example 2
In the following example, MRTPROC is a MRT procedure that causes a MRT
program to run. The number 126 is data passed to the MRT program on
its first input operation from the requesting display station.
MRTPROC 126
George Applegate
gappleg8@xxxxxxxxxx
.
- Prev by Date: Re: SMTP Domain (Mail Problem)
- Next by Date: Re: SQL statments in ILE COBOL
- Previous by thread: Re: Host Print Transform in Raster Mode?
- Next by thread: Re: SQL statments in ILE COBOL
- Index(es):
Relevant Pages
|