SORT-MERGE/XL Programmer's Guide (32650-90884)

Appendix D 119
FORTRAN Program Examples
Example of Using an Altered Sequence
ALTSEQ(34:49) = '@AaBbCcDdEeFfGgH'
ALTSEQ(50:65) = 'hIiJjKkLlMmNnOoP'
ALTSEQ(66:80) = 'pQqRrSsTtUuVvWwX'
ALTSEQ(81:95) = 'xYyZz[\]^^_{|}~'
C
call HPSORTINIT (STATUS, INPUTFILES, OUTPUTFILE
2 ,OUTPUT_OPTION, ,,, NUMKEYS, KEYS
3 ,ALTSEQ,,,STATISTICS)
if (STATUS .ne. 0) then
MESSAGE = ' '
call HPSORTERRORMESS (STATUS, MESSAGE, LENGTH)
print *,MESSAGE
endif
C
call HPSORTEND (STATUS)
if (STATUS .ne. 0) then
MESSAGE = ' '
call HPSORTERRORMESS (STATUS, MESSAGE, LENGTH)
print *,MESSAGE
endif
C
return
end
C
subroutine CLOSE_FILES
C
system intrinsic FCLOSE
C
integer*2 DISPOSITION
2 ,SECURITYCODE
C
integer DATAFILENUM
2 ,FRUITFILENUM
3 ,STATUS
C
common /PARMS/ DATAFILENUM, FRUITFILENUM, STATUS
C
DISPOSITION = 0
SECURITYCODE = 0
C
call FCLOSE (DATAFILENUM, DISPOSITION, SECURITYCODE)
call FCLOSE (FRUITFILENUM, DISPOSITION, SECURITYCODE)
C
return
end
When this program is executed, the output is written to FRUIT. To view FRUIT:
:print fruit
Apple
banana
Grapes
grapes
peach
Pear
orange