SUBROUTINE VCDTIN ( * * inputs * : TBNAME, COLNAM, NCOL, * * outputs * : TP, COLIDN, NROWS, STATUS) * * Module number: * * Module name: * * Keyphrase: * ---------- * acquire column identifiers and pointer to table descriptor of input table * * Description: * ------------ * This routine will open the input table, check and find identifiers for all * columns. It also gives the pointer to table descriptor and the number of * rows in the table. This routine is identical to CDTIN except that this * one does not issue error messages. * * FORTRAN name: VCDTIN.FOR * * Keywords of accessed files and tables: * -------------------------------------- * Name I/O Description / Comments * none * * Subroutines Called: * ------------------- * CDBS: * none * SDAS: * UTCFND, UTPGTI, UTTCLO * Others: * none * * History: * -------- * Version Date Author Description * 1 11-15-89 J.-C. HSU copy from CDTIN *------------------------------------------------------------------------------- * *== input: * --output table name CHARACTER*(*) TBNAME, * --column name(s) : COLNAM(1) * --number of columns INTEGER NCOL * *== output: * --pointer to table descripter INTEGER TP, * --column identifiers : COLIDN(1), * --number of rows already written in * --output table : NROWS, * --error status : STATUS *==========================begin iraf77.inc (without INTEGER*2)================= * Include file for the iraf77 FORTRAN interface to the IRAF VOS * Get IRAF common into main program * LOGICAL MEMB(1) INTEGER MEMI(1) INTEGER MEML(1) REAL MEMR(1) DOUBLE PRECISION MEMD(1) COMPLEX MEMX(1) EQUIVALENCE (MEMB, MEMI, MEML, MEMR, MEMD, MEMX) COMMON /MEM/ MEMD * * File I/O access modes * INTEGER RDONLY PARAMETER (RDONLY = 1) INTEGER RDWRIT PARAMETER (RDWRIT = 2) INTEGER WRONLY PARAMETER (WRONLY = 3) INTEGER APPEND PARAMETER (APPEND = 4) INTEGER NEWFIL PARAMETER (NEWFIL = 5) INTEGER TMPFIL PARAMETER (TMPFIL = 6) INTEGER NEWCPY PARAMETER (NEWCPY = 7) INTEGER NEWIMG PARAMETER (NEWIMG = 5) * * codes for data types * INTEGER TYBOOL PARAMETER (TYBOOL = 1) INTEGER TYCHAR PARAMETER (TYCHAR = 2) INTEGER TYSHOR PARAMETER (TYSHOR = 3) INTEGER TYINT PARAMETER (TYINT = 4) INTEGER TYLONG PARAMETER (TYLONG = 5) INTEGER TYREAL PARAMETER (TYREAL = 6) INTEGER TYDOUB PARAMETER (TYDOUB = 7) INTEGER TYCPLX PARAMETER (TYCPLX = 8) INTEGER TYUSHT PARAMETER (TYUSHT = 11) INTEGER TYUBYT PARAMETER (TYUBYT = 12) * * TYTEXT is a special code for the iraf77 interface; it is not in the VOS * INTEGER TYTEXT PARAMETER (TYTEXT = 13) *========================end iraf77.inc========================================= *======================begin tblpar.inc========================================= *--Lengths of character strings: * * 19 column name * 19 units for a column * 7 format for displaying a column * *--These may be set by UTPSET and/or read by UTPSTA: * * Length of row (unit = size of real) INTEGER TBRLEN PARAMETER (TBRLEN = 1) * Increase row length INTEGER TBIRLN PARAMETER (TBIRLN = 2) * Number of rows to allocate INTEGER TBALLR PARAMETER (TBALLR = 3) * Increase alloc num of rows INTEGER TBIALR PARAMETER (TBIALR = 4) * Which type of table? (row or column) INTEGER TBWTYP PARAMETER (TBWTYP = 5) * Maximum number of user parameters INTEGER TBMXPR PARAMETER (TBMXPR = 6) * Maximum number of columns INTEGER TBMXCL PARAMETER (TBMXCL = 7) * type = row-ordered table INTEGER TBTYPR PARAMETER (TBTYPR = 11) * type = column-ordered table INTEGER TBTYPC PARAMETER (TBTYPC = 12) * *--These may be read by UTPSTA but may not be set: * * Number of rows written to INTEGER TBNROW PARAMETER (TBNROW = 21) * Number of columns defined INTEGER TBNCOL PARAMETER (TBNCOL = 22) * Amount of row used (unit=size of real) INTEGER TBRUSD PARAMETER (TBRUSD = 23) * Number of user parameters INTEGER TBNPAR PARAMETER (TBNPAR = 24) *==========================end tblpar.inc======================================= *=========================begin hsp.inc========================================= * --status return code INTEGER OK, ERRNUM(20) INTEGER DEST, PRIO DATA OK /0/ DATA ERRNUM /701, 702, 703, 704, 705, 706, 707, 708, 709, 710, : 711, 712, 713, 714, 715, 716, 717, 718, 719, 720/ * --message destination and priority DATA DEST, PRIO /1, 0/ *=========================end hsp.inc=========================================== *------------------------------------------------------------------------------ * * open the table, get the number of rows * CALL UTTOPN (TBNAME, RDONLY, TP, STATUS) * IF (STATUS .NE. OK) THEN GO TO 999 END IF * CALL UTPGTI (TP, TBNROW, NROWS, STATUS) IF (STATUS .NE. OK) THEN GO TO 999 END IF * * check column names, get their identifiers * CALL UTCFND (TP, COLNAM, NCOL, COLIDN, STATUS) * IF (STATUS .NE. OK) THEN GO TO 999 END IF * STATUS = OK GO TO 1000 * 999 CONTINUE * 1000 RETURN END