SUBROUTINE COPY( STATUS )
* Global Constants:
INCLUDE ’GRP_PAR’ ! Standard GRP constants
* Local Variables:
INTEGER CIN ! GRP identifier for an input catalogue
INTEGER COUT ! GRP identifer for an output catalogue
LOGICAL FLAG ! Has group ended with flag character?
INTEGER GIDIN ! GRP identifier for group of input cat’s
INTEGER GIDOUT ! GRP identifer for group of output cat’s
INTEGER I ! Loop counter
INTEGER NUMIN ! Number of input catalogues
INTEGER NUMOUT ! Number of output catalogues
INTEGER STATUS ! The global status
*.
* Inialise the group identifiers to indicate that groups do not have
* any initial members.
GIDIN = GRP__NOID
GIDOUT = GRP__NOID
* Create group of input catalogues using the parameter IN.
CALL CTG_ASSOC( ’IN’, .TRUE., GIDIN, NUMIN, FLAG, STATUS )
* Create group of output catalogues using the parameter OUT, that
* possibly works by modifying the values in the input group.
CALL CTG_CREAT( ’OUT’, GIDIN, GIDOUT, NUMOUT, FLAG, STATUS )
* Loop over group members.
DO I = 1, NUMIN
* Get the identifier for an existing catalogue from the input group.
CALL CTG_NDFAS( GIDIN, I, ’READ’, CIN, STATUS )
* Get the identifier for the output catalogue from the output group.
CALL CTG_NDFAS( GIDOUT, I, ’WRITE’, COUT, STATUS )
* Proceed to create output catalogue by editing the input catalogue
* using the CAT library.
: : : :
* Release CAT resources.
CALL CAT_TRLSE( CIN, STATUS )
CALL CAT_TRLSE( COUT, STATUS )
END DO
* Release GRP resources.
CALL GRP_DELET( GIDIN, STATUS )
CALL GRP_DELET( GIDOUT, STATUS )
END