×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Scripting: handling of blank or nil entries by "ENTER"

Scripting: handling of blank or nil entries by "ENTER"

Scripting: handling of blank or nil entries by "ENTER"

(OP)
Problem: in the scripting language < KEY ENTER variable !TO MIMS-field> apparently  does not update the MIMS-field if "variable" is blank?

I need to update the field in MIMS with whatever is in the input variable, including spacing out existing information in MIMS, if the input variable is nil.  

Can anyone advise how this can be achieved on a field-by-field basis (do not wish to use CLEAR which clears entire screen).

More details:

I am writing a script to maintain MSM685-Fixed Asset Depreciation. We wish to:
- clear all fields related to "Depreciation Method" or unconditionally enter the values from the input file, including nil values
-  while remaining fields such as capital value, revalue amoounts, etc must only be changed if a value is present in the input file; if the field at input is blanks, do not change it in MIMS

Therefore we do NOT wish to use CLEAR as this would space out all the fields on the screen.

I am looking in particular at following 2 fields:
Manual Depreciation Rate and Manual Depreciation Final Period

I have found that my code will update these fields in MIMS if they have some values, but DOES not space out the MIMS fields if the input fields are NIL or spaces in the csv file.

I coded as following:

SUBROUTINE READ_INPUT
  SET 'ROUTINE_NAME=READ_INPUT'
  IMPORT FILE (INPUT_FILE) FORMAT (CSV) EXTRACT
  SET 'OPTION='  CSV_1
  SET 'EQUIP='  CSV_2
  SET 'ASSET='  CSV_3
  SET 'SUB_ASSET=' CSV_4
  SET 'BK_TX=' CSV_5
  SET 'DESC=' CSV_6
  SET 'DEPR_METH=' CSV_7
  SET 'DEPR_RATE=' CSV_8
  SET 'ACCEL_RATE=' CSV_9
  SET 'ACCEL_PER=' CSV_10
  SET 'MAN_RATE=' CSV_11
  SET 'MAN_PER=' CSV_12


....

SUBROUTINE MSM685C_KEY_DATA MSM685C
  SET 'ROUTINE_NAME=MSM685C_KEY_DATA'
  SYSTEM 'ECHO Entering Data for Asset: ' ASSET {BL 12} EQUIP {BL 30}
  KEY
  . !ENTER DEPR_METH         !TO @DEPR_METHOD3I
  . !ENTER DEPR_RATE         !TO @DEPR_RATE3I
  . !ENTER ACCEL_RATE        !TO @ACCEL_DEPR_RT3I
  . !ENTER ACCEL_PER         !TO @FIN_ACCEL_PER3I
  . !ENTER MAN_RATE          !TO @MAN_PER_DEPR3I
  . !ENTER MAN_PER           !TO @FIN_MAN_PER3I
  . !ENTER RATE_TABLE        !TO @RATE_TABLE3I
  . !ENTER RECOV_PER         !TO @RECOV_PERIOD3I
  . !ENTER DIVIDEND_ST       !TO @DIVIDEND_STAT3I
  . !ENTER DIVISOR_ST        !TO @DIVISOR_STAT3I
  . !IF EST_LIFE        !ENTER EST_LIFE          !TO @EST_MM_LIFE3I
  . !ENTER LIFE_GRP          !TO @LIFE_GRP_CODE3I
  . !IF FRGN_CURR       !ENTER FRGN_CURR         !TO @FOREIGN_CURR3I
  . !IF FRGN_AMT        !ENTER FRGN_AMT          !TO @FOR_CURR_AMT3I
  . !IF CAP_DATE        !ENTER CAP_DATE          !TO @CAPITAL_DATE3I
  . !IF REVAL_DATE      !ENTER REVAL_DATE        !TO @REVAL_DATE3I
  . !IF ACC_DEP_PRV_YR  !ENTER ACC_DEP_PRV_YR    !TO @ACCUM_DEP_PREV3I
  . !IF ACC_DEP_CRT_YR  !ENTER ACC_DEP_CRT_YR    !TO @ACCUM_DEP_THIS3I
  . !IF EST_DISP_VAL    !ENTER EST_DISP_VAL      !TO @EST_DISPOS_VAL3I
  . !IF CAP_COST        !ENTER CAP_COST          !TO @CAPITAL_COST3I
  . !IF REVAL_AMT       !ENTER REVAL_AMT         !TO @REVAL_AMT3I
  . !SEND
RETURN
  

RE: Scripting: handling of blank or nil entries by "ENTER"

A field can be cleared by entering a space value (rather than a null). For example:


. !IF      MAN_RATE !ENTER MAN_RATE   !TO @MAN_PER_DEPR3I
. !IF !NOT MAN_RATE !ENTER ' '        !TO @MAN_PER_DEPR3I

RE: Scripting: handling of blank or nil entries by "ENTER"

(OP)
Thanks. Your help is appreciated.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close