Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Depends on what you want to do.
HEADER1 and TRAILER1 support the slash operator (/), so you can create multiple lines, but with hard-coded literal values only.
OUTFIL BUILD also supports the slash operator, so you can BUILD multiple records from input and literal values.
OUTFIL REPEAT replicates input, allowing you to use input for multiple, amended, values.
You can also simply have multiple input records on SORTIN, and treat them differently depending on an identifying value with IFTHEN=(WHEN=(logical expression).
I've used JOINKEYS for generating symbols, INREC, OUTREC, OUTFIL then also ICETOOL has some operators which I've found useful for this.
All depends on the actual task. The simpler the symbol, the less code. Easiest is multiple input records, with one-to-one mapping for output.
You should also look at system symbols (as in sticky post in the first page of the DFSORT forum) and JPn symbols, which allow data to be taken from PARM values and used in SORT statements.
Symbols are a whole heap of fun, and help in many ways. There are examples here, though not as many as there could be, as people tend to want the spoon-fed answer they can just do in one copy/paste.