Program m01ccfe
! M01CCF Example Program Text
! Mark 28.7 Release. NAG Copyright 2022.
! .. Use Statements ..
Use nag_library, Only: m01ccf
! .. Implicit None Statement ..
Implicit None
! .. Parameters ..
Integer, Parameter :: nin = 5, nout = 6
! .. Local Scalars ..
Integer :: i, ifail, l1, l2, m1, m2
! .. Local Arrays ..
Character (12), Allocatable :: ch(:)
! .. Executable Statements ..
Write (nout,*) 'M01CCF Example Program Results'
! Skip heading in data file
Read (nin,*)
Read (nin,*) m2
Allocate (ch(m2))
m1 = 1
Do i = m1, m2
Read (nin,'(A)') ch(i)
End Do
l1 = 7
l2 = 12
ifail = 0
Call m01ccf(ch,m1,m2,l1,l2,'Reverse ASCII',ifail)
Write (nout,*)
Write (nout,99999) 'Records sorted on columns ', l1, ' to ', l2
Write (nout,*)
Write (nout,99998)(ch(i),i=m1,m2)
99999 Format (1X,A,I2,A,I2)
99998 Format (1X,A)
End Program m01ccfe