Example 7

  SELECT FROM(INPUT) TO(ONLYONE) ON(23,3,FS) NODUPS USING(CTL1)

This example shows how you can use USING(xxxx) to supply an OUTFIL statement to modify the TO data set. SELECT chooses the same output records as for Example 2, but an OUTFIL statement is used to further modify those records for output to the ONLYONE data set.

The CTL1CNTL data set contains:
  OUTFIL FNAMES=ONLYONE,
    REMOVECC,
    INCLUDE=(23,3,FS,LT,100),
    OUTREC=(1:1,7,8:C'|',11:11,7,19:C'|',23:23,3,FS,M11,
            27:C'|',30:30,15),
    TRAILER1=(/,'TOTAL= ',TOT=(23,3,FS,M11,LENGTH=6))

and the ONLYONE data set might look as follows:

DFSRT2 |  EISSLER |   005 |  DOC.EXAMPLES
DFSRT1 |  PACKER  |   008 |  ICETOOL.SMF.RUN
USR002 |  EISSLER |   012 |  DOC.EXAMPLES
SYS003 |  YAEGER  |   032 |  ICETOOL.TEST.CA

TOTAL= 000057