jerryte
Active User
Joined: 29 Oct 2010 Posts: 202 Location: Toronto, ON, Canada
|
|
|
|
I want to share the below sort control cards that can be used to convert a FBA dataset into FB. It shifts every line over 1 byte and inserts a blank line when it encounters a non-blank print control char. This makes the resulting dataset easy to import into another file (such as a Word document) and not waste space.
HINT: use the "Courier New" font and switch to Landscape with 0.5 inch margins to make the file fit.
Code: |
RECORD TYPE=F,LENGTH=(133,,132)
SORT FIELDS=COPY
** IF FIRST CHAR IS BLANK THEN COPY REMAINING RECORD
** ALL OTHER RECORDS INSERT A BLANK LINE PRIOR
OUTFIL FILES=OUT,
IFTHEN=(WHEN=(1,1,CH,EQ,C' '),BUILD=(2,132)),
* IFTHEN=(WHEN=(1,1,CH,EQ,C'1'),BUILD=(/,2,132)),
* IFTHEN=(WHEN=(1,1,CH,EQ,C'0'),BUILD=(/,2,132)),
* IFTHEN=(WHEN=(1,1,CH,EQ,C'-'),BUILD=(2/,2,132)),
IFTHEN=(WHEN=NONE,BUILD=(/,2,132)) |
NOTE: the lines begining with an asterisk are optional can be removed. Also the RECORD statement is not required but I put it there as an error check. If the input file record length was not 133 byte then DFSORT will fail. |
|