|
System SAMPLIB member DFMXSRTI, for example, SYS1.SAMPLIB(DFMXSRTI)
shown in Figure 1, shows how to install
the DFMXSORT DataAgent routine.
Figure 1. Sample Installation for the DFMXSORT DataAgent
Routine Part 1 of 4//DFMXSRTI JOB ,'DFMXSORT SETUP',MSGLEVEL=(1,1),MSGCLASS=A,
// USER=IBMUSER,PASSWORD=IBM,REGION=1M
//********************************************************************/
//*PROPRIETARY V3 STATEMENT
//*LICENSED MATERIALS - PROPERTY OF IBM
//*5695-DF1
//*(C) COPYRIGHT 1997 IBM CORP.
//*END PROPRIETARY V3 STATEMENT
//********************************************************************/
//* Sample installation for DFMXSORT DataAgent routine. Modify the
//* job statement, etc. as appropriate for your installation.
//********************************************************************/
//* This sample uses &PREFIX to generate input and output filenames.
//* For example, &PREFIX.SORTIN will be used for input and
//* &PREFIX.SORTOUT will be used for output.
//*
//* A sample input file, IBMUSER.DFMXSORT.SORTIN, is also provided.
//*
//* It could be cloned with other filenames and sort parameters
//* or could be generalized to use dynamic allocation for the
//* input and output files. Pseudocode is included to illustrate
//* the types of changes that would be required. If changes are
//* made, then you must remove DD statements for SORTIN and
//* SORTOUT from the cataloged procedure.
//*
//* Once this installation job has run, logon to a workstation with
//* the prerequisite level of SdU and with an APPC connection to the
//* mainframe and issue the following command:
//* dfmacall agent x:ibmuser.dfmxsort.sortin
//* 'dfmxsort,prefix=ibmuser.dfmxsort'
//* parm 'sort fields=(17,6,ch,a)'
//*
//* Refer to DFMACALL for details.
//*
//********************************************************************/
Figure 2. Sample Installation for the DFMXSORT DataAgent
Routine Part 2 of 4//********************************************************************/
//* Clean up test data sets. Remove this step from production version.
//********************************************************************/
//CLEANUP EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE ( -
IBMUSER.DFMXSORT.* -
) NONVSAM PURGE SCRATCH
IF LASTCC = 8 THEN DO
SET LASTCC = 0
SET MAXCC = 0
END
/*
//********************************************************************/
//* Generate SORTIN and allocate SORTOUT */
//********************************************************************/
//STEP1 EXEC PGM=IEBGENER
//SYSUT2 DD
DSN=IBMUSER.DFMXSORT.SORTIN,DISP=(NEW,CATLG),UNIT=SYSDA,
// DCB=(LRECL=80,BLKSIZE=0,RECFM=FB),
// SPACE=(TRK,(1,1))
//SORTOUT DD DSN=IBMUSER.DFMXSORT.SORTOUT,DISP=(NEW,CATLG),
//
UNIT=SYSDA,DCB=(LRECL=80,BLKSIZE=0,RECFM=FB),
// SPACE=(TRK,(1,1))
//* Create records with a 6 character sort field in column 17
//* and with a flag in column 40 that is used to omit (=1) or
//* include the record. The program itself contains the parameters
//* for the sort (ascending on columns 17-22) and the control file
//* contains the definition of what records to include/omit.
//SYSUT1 DD DATA
RECORD NUMBER = 000030, OMIT FLAG IS = 1 .............................
RECORD NUMBER = 000888, OMIT FLAG IS = 0 .............................
RECORD NUMBER = 000887, OMIT FLAG IS = 1 .............................
RECORD NUMBER = 099999, OMIT FLAG IS = 0 .............................
RECORD NUMBER = 100000, OMIT FLAG IS = 1 .............................
RECORD NUMBER = 100001, OMIT FLAG IS = 0 .............................
RECORD NUMBER = 111111, OMIT FLAG IS = 1 .............................
RECORD NUMBER = 111110, OMIT FLAG IS = 1 .............................
RECORD NUMBER = 211111, OMIT FLAG IS = 0 .............................
RECORD NUMBER = 999999, OMIT FLAG IS = 1 .............................
RECORD NUMBER = 000000, OMIT FLAG IS = 0 .............................
/*
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
Figure 3. Sample Installation for the DFMXSORT DataAgent
Routine Part 3 of 4//*********************************************************************
//* Assemble the DataAgent Sample DFMXSORT
//*********************************************************************
//ASM01 EXEC PGM=IEV90,PARM='OBJECT,NODECK'
//SYSPRINT DD SYSOUT=*
//SYSLIB DD DSN=SYS1.MACLIB,DISP=SHR
//SYSUT1 DD UNIT=SYSDA,SPACE=(1700,(600,100))
//SYSUT2 DD UNIT=SYSDA,SPACE=(1700,(600,100))
//SYSUT3 DD UNIT=SYSDA,SPACE=(1700,(600,100))
//SYSLIN DD DSN=&&DFMXSORT,DISP=(,PASS),
// UNIT=SYSDA,SPACE=(TRK,(2,2,2))
//SYSIN DD DSN=SYS1.SAMPLIB(DFMXSORT),DISP=SHR
//********************************************************************
//* Link Edit DataAgent Routine DFMXSORT *
//********************************************************************
//LINK1 EXEC
PGM=IEWL,PARM='XREF,LET,LIST,AMODE=31,RMODE=ANY'
//SYSPRINT DD SYSOUT=*
//OBJ DD DSN=&&DFMXSORT,DISP=(OLD,DELETE)
//SYSLMOD DD DSN=SYS1.LINKLIB(DFMXSORT),DISP=SHR
//SYSUT1 DD UNIT=SYSDA,SPACE=(TRK,(80,10))
//SYSLIN DD *
INCLUDE OBJ
ENTRY DFMXSORT
NAME DFMXSORT(R)
/*
//*********************************************************************
//* Build Agent JCL in SYS1.PROCLIB
//*********************************************************************
//STEP1 EXEC PGM=IEBGENER
//SYSUT2 DD DISP=SHR,DSN=SYS1.PROCLIB(DFMXSORT)
//SYSUT1 DD DATA
//DFMXSORT JOB ,MSGCLASS=A
//*********************************************************************
//* Set appropriate msgclass above for debug vs production
//*********************************************************************
//DFMXSORT PROC DFMINIT=,PREFIX=IBMUSER.DFMXSORT
//DFMAGENT EXEC PGM=&DFMINIT
//*********************************************************************
//* Run DFMXSORT DataAgent Sample
//*
//* Sort input comes from IBMUSER.DFMXSORT.SORTIN by default.
//* Sorted data goes into IBMUSER.DFMXSORT.SORTOUT by default.
//* You should modify the names, space allocation, etc. as appropriate
//* for your installation.
Figure 4. Sample Installation for the DFMXSORT DataAgent
Routine Part 4 of 4//*********************************************************************
//* Add STEPLIB statements as appropriate for your installation.
//*STEPLIB DD DSN=...,DISP=SHR
//* DD DSN=SYS1.LINKLIB,DISP=SHR
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=&PREFIX..SORTIN,DISP=SHR
//SORTOUT DD DSN=&PREFIX..SORTOUT,DISP=SHR
//SORTCNTL DD DSN=SYS1.PROCLIB(DFMXSORI),DISP=SHR
//DFMXSORT PEND
//GO EXEC DFMXSORT
/*
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//*********************************************************************
//* Build omit control statement in SYS1.PROCLIB
//*********************************************************************
//STEP2 EXEC PGM=IEBGENER
//SYSUT2 DD DISP=SHR,DSN=SYS1.PROCLIB(DFMXSORI)
//SYSUT1 DD DATA
* The following omit statement will ensure that only the
* records without a 1 in column 40 appear in the sortout data set
OMIT COND=(40,4,CH,EQ,C'1')
/*
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
|