Adding a row to a tabfile table
Tuesday, July 29, 2008 at 10:09AM The following code adds a row to an existing tabfile table:
CONNECT TABFILE updates FILENAME 'UPDATES.TBF' WRITE
PROGRAM
c
c program to access update details tabfile and addrow for the update being undertaken.
c
c write cohort, current database update level, date, time, user and update comment
STRING*140 COMMENT
COMPUTE UPDLEVELNOW=UPDLEVEL(0)
NEW ROW IS UPDATES.TABLE1 TUPDATE INDEXED BY UPDLEVDESC(UPDLEVELNOW)
. COMPUTE UPDDATE=TODAY(0)
. COMPUTE UPDID=SIRUSER('')
. COMPUTE COMMENT="
. PUT VARS UPDDATE UPDID COMMENT
END ROW IS
IFTHEN(SYSTEM(28) <>1)
. WRITE '*** ERROR IN WRITING TO UPDATES TABFILE - ROW NOT WRITTEN ***'
ENDIF
END PROGRAM
DISCONNECT TABFILE updates
We use a version of this program as a member, calling it everytime we do an update, providing us with a handy log of all our updates and schema modifications


Reader Comments