Thursday, July 6, 2017

Check if a record exists

There are a few ways to check if a record exists in a file.

1. Call the S.VERIFY.RECORD.EXISTS subroutine:

X.RECORD.ID = record ID to check

CALL S.VERIFY.RECORD.EXISTS(X.EXISTS, X.FILE.NAME, X.RECORD.ID)

IF X.EXISTS = 0 THEN // record doesn't exists
END
2. Use  CONFIRMED command (this is good for when the subroutine can't be called, such as in IS sub):

X.FILE.NAME = A.FILE.NAME
X.RECORD.ID = A.RECORD.ID
A.EXISTS = 0
IF LEN(X.FILE.NAME) AND LEN(X.RECORD.ID) THEN
CONFIRM X.RECORD.ID IN_FILE(X.FILE.NAME)

IF CONFIRMED THEN
A.EXISTS = 1
END
END
Source: Neal Webb

3 comments:

  1. You're very welcome! Envision is a proprietary language, so you can't really learn it yourself. However, Envision command reference is available for the public, so that's where I would go and look up most of these stuffs.

    ReplyDelete
  2. Hi Duong, are you still working with Ellucian code?

    ReplyDelete
    Replies
    1. Hi Marian! Yes, I still do contract works from time to time, but it's no longer my primary job.

      Delete