Category : File Managers
Archive   : PS431.ZIP
Filename : PSDEMO07.SPC

 
Output of file : PSDEMO07.SPC contained in archive : PS431.ZIP

#
/*
This demonstration will sort the ingredients list by the second
word in each line. Notice that the second word starts in various
positions in each record. ParaSort is the only sort that can key
on fields that are not in fixed positions.
*/
SORT psdata02.001 VI . GIVING psdata02.004 VARIABLEOUTPUT .,.
records 40
INRECORD - (p'[ \t]*[^ \t]+[ \t]+',1,80)
INRECORD c,.,20 (p'[^ \t]*[ \t]',.,80)
INRECORD c,.,. (c,1,80)
C 1,20 aasc
C 21,10 asc
OUTRECORD C,.,. (c,21,80)
#
SORT psdata02.001 VI . GIVING psdata02.004 VARIABLEOUTPUT .,.
records 40
INRECORD - (p'[ \t]*[^ \t]+[ \t]+',1,80)
INRECORD c,.,20 (p'[^ \t]*[ \t]',.,80)
INRECORD c,.,. (c,1,80)
C 1,20 aasc
C 21,10 asc
OUTRECORD C,.,. (c,21,80)