I'm a little new to the more detailed use of the Aspect scripts.
Here is my need.
Creating on a Voicemail system distribution lists.
The input file could have up to eight fields of data.
But will always have four fields that are constant; MBX #, user Name, Dept name, temporary passcode. All fields are seperated with a pip "|".
Field 5 would be the first dist list member number. Field 6 could have the next member number. Then Field 7 and then 8 could be more members.
Now when reading the line of data, how do I get the script to jump to the next procedure if the data in field(s) 6, 7 or 8 are null?
The next proc would be an tranmit of the creation steps for the dist list members. Here is my script.
Thanks.
;================================================================*
; NOTE: The source file must have more than 1 record to run *
;================================================================*
; Input File - Data *
; *
; There are 8 fields in each line of input data *
; ===All fields are seperated with a pip "|" == *
; *
; Field #1 = Mailbox number "szMbxno" *
; Field #5 = Distribution list #1, 1st entry "szDL0101" *
; Field #6 = Distribution list #1, 2nd entry "szDL0102" *
; Field #7 = Distribution list #1, 3rd entry "szDL0103" *
; Field #8 = Distribution list #1, 4th entry "szDL0104" *
;----------------------------------------------------------------*
; These fields are in the source file and are not needed *
; *
; Field #2 = User Name "szUsername" *
; Field #3 = Department code "szDeptcd" *
; Field #4 = Temporary passcode "szPasscode" *
; *
;******************************************************************
;
INTEGER LOOPFLAG
proc main ;Beginning of main procedure
string szFile ;File name to be entered to be opened for data
string szLine ;Variable to store line from file.
string szMbxno ;String for mailbox number
string szUsername ;String for Users Name.
string szDeptcd ;String for Department code
string szPasscode ;String for Passcode to be assigned
string szDL0101 ;String for Dist list 01 member 01
string szDL0102 ;String for Dist list 01 member 02
string szDL0103 ;String for Dist list 01 member 03
string szDL0104 ;String for Dist list 01 member 04
;
usermsg "This Script will create the Dorm Shared Extension Mailbox dist list members."
sdlginput "Input File Name Entry" "Enter File name:" szFile
usermsg "the file name entered is :%s!" szFile
;******************************************************************
FOPEN 1 szFile READ TEXT ;OPEN FILE IN READ MODE ONLY
;
IF FAILURE ;IF FILE OPEN FAILS DISPLAY ERR MSG
ERRORMSG "Couldn't open :%s!" szFile "For Input"
EXIT ;EXIT SCRIPT
ENDIF
;
WHILE 1 ;LOOP FOREVER
FFLUSH 1
FGETS 1 szLine ;Get a line from the file and extract the
;
IF FEOF 1 ;IF EOF REACHED ..
EXITWHILE ;JUMP OUT OF WHILE LOOP
ENDIF
; Seperate the field data
;
strtok szMbxno szLine "|" 1 ; Mailbox number
strtok szUsername szLine "|" 1 ; Users Name has a comma in it
strtok szDeptcd szLine "|" 1 ; Department code
strtok szPasscode szLine "|" 1 ; Temporary Passcode
strtok szDL0101 szLine "|" 1 ; Dist list 01 member 01
strtok szDL0102 szLine "|" 1 ; Dist list 01 member 02
strtok szDL0103 szLine "|" 1 ; Dist list 01 member 03
strtok szDL0104 szLine "|" 1 ; Dist list 01 member 04
;
; Need to check for null values for members 2 to 4. The dlist members could be 1 to 4.
; If there are less than 4, then do not need the action to create dlist entries for those.
;
; End of the line of data needed
;
; To create the mailbox data
; Now to create the Distribution List 01 entry, member 01
;
TRANSMIT "dcreate m1=" ; QNX batch mode command
TRANSMIT szMbxno ; From file mailbox NUMBER
TRANSMIT " dl=1 dm=" ; dlist 1, member is...
TRANSMIT szDL0101 ; Member = Shared Ext MB number
; TRANSMIT "-s" ; Dist list is to be sorted
; Default is Unsorted list
TRANSMIT " +c -v ^M" ; Chk for dup and do not show detail then SEND CARRIAGE RETURN
WAITFOR "#" 10 ; WAIT 10 SECONDS FOR COMMAND COMPLETION
TRANSMIT "^M" ; SEND 2nd CARRIAGE RETURN to force # back
Pause 1 ; pause 1 second
;
; Now to create the Distribution List 01 entry, member 02
;
TRANSMIT "dcreate m1=" ; QNX batch mode command
TRANSMIT szMbxno ; From file mailbox NUMBER
TRANSMIT " dl=1 dm=" ; dlist 1, member is...
TRANSMIT szDL0102 ; Member = Shared Ext MB number
; TRANSMIT "-s" ; Dist list is to be sorted
; Default is Unsorted list
TRANSMIT " +c -v ^M" ; Chk for dup and do not show detail then SEND CARRIAGE RETURN
WAITFOR "#" 10 ; WAIT 10 SECONDS FOR COMMAND COMPLETION
TRANSMIT "^M" ; SEND 2nd CARRIAGE RETURN to force # back
Pause 1 ; pause 1 second
;
; Now to create the Distribution List 01 entry, member 03
;
TRANSMIT "dcreate m1=" ; QNX batch mode command
TRANSMIT szMbxno ; From file mailbox NUMBER
TRANSMIT " dl=1 dm=" ; dlist 1, member is...
TRANSMIT szDL0103 ; Member = Shared Ext MB number
; TRANSMIT "-s" ; Dist list is to be sorted
; Default is Unsorted list
TRANSMIT " +c -v ^M" ; Chk for dup and do not show detail then SEND CARRIAGE RETURN
WAITFOR "#" 10 ; WAIT 10 SECONDS FOR COMMAND COMPLETION
TRANSMIT "^M" ; SEND 2nd CARRIAGE RETURN to force # back
Pause 1 ; pause 1 second
;
; Now to create the Distribution List 01 entry, member 04
;
TRANSMIT "dcreate m1=" ; QNX batch mode command
TRANSMIT szMbxno ; From file mailbox NUMBER
TRANSMIT " dl=1 dm=" ; dlist 1, member is...
TRANSMIT szDL0104 ; Member = Shared Ext MB number
; TRANSMIT "-s" ; Dist list is to be sorted
; Default is Unsorted list
TRANSMIT " +c -v ^M" ; Chk for dup and do not show detail then SEND CARRIAGE RETURN
WAITFOR "#" 10 ; WAIT 10 SECONDS FOR COMMAND COMPLETION
TRANSMIT "^M" ; SEND 2nd CARRIAGE RETURN to force # back
Pause 1 ; pause 1 second
;
;
;******************************************************************
; Created the required data for a Mailbox, get more data input *
;******************************************************************
; end of the mailbox on to the next
CALL CMD_PMPT ;WAIT FOR # PROMPT LOOP
;
ENDWHILE
;
FCLOSE 1 ;CLOSE THE FILE
CALL CMD_PMPT ;WAIT FOR 6.0 # PROMPT LOOP
TRANSMIT "date^M" ;EXIT QNX OPERATING SYSTEM
;
; Show System Time, would be at QNX prompt now.
;
usermsg "End of script, either setup to run the next required Script or exit Procomm"
;
; Inform User that the Script is completed
;
ENDPROC
Here is my need.
Creating on a Voicemail system distribution lists.
The input file could have up to eight fields of data.
But will always have four fields that are constant; MBX #, user Name, Dept name, temporary passcode. All fields are seperated with a pip "|".
Field 5 would be the first dist list member number. Field 6 could have the next member number. Then Field 7 and then 8 could be more members.
Now when reading the line of data, how do I get the script to jump to the next procedure if the data in field(s) 6, 7 or 8 are null?
The next proc would be an tranmit of the creation steps for the dist list members. Here is my script.
Thanks.
;================================================================*
; NOTE: The source file must have more than 1 record to run *
;================================================================*
; Input File - Data *
; *
; There are 8 fields in each line of input data *
; ===All fields are seperated with a pip "|" == *
; *
; Field #1 = Mailbox number "szMbxno" *
; Field #5 = Distribution list #1, 1st entry "szDL0101" *
; Field #6 = Distribution list #1, 2nd entry "szDL0102" *
; Field #7 = Distribution list #1, 3rd entry "szDL0103" *
; Field #8 = Distribution list #1, 4th entry "szDL0104" *
;----------------------------------------------------------------*
; These fields are in the source file and are not needed *
; *
; Field #2 = User Name "szUsername" *
; Field #3 = Department code "szDeptcd" *
; Field #4 = Temporary passcode "szPasscode" *
; *
;******************************************************************
;
INTEGER LOOPFLAG
proc main ;Beginning of main procedure
string szFile ;File name to be entered to be opened for data
string szLine ;Variable to store line from file.
string szMbxno ;String for mailbox number
string szUsername ;String for Users Name.
string szDeptcd ;String for Department code
string szPasscode ;String for Passcode to be assigned
string szDL0101 ;String for Dist list 01 member 01
string szDL0102 ;String for Dist list 01 member 02
string szDL0103 ;String for Dist list 01 member 03
string szDL0104 ;String for Dist list 01 member 04
;
usermsg "This Script will create the Dorm Shared Extension Mailbox dist list members."
sdlginput "Input File Name Entry" "Enter File name:" szFile
usermsg "the file name entered is :%s!" szFile
;******************************************************************
FOPEN 1 szFile READ TEXT ;OPEN FILE IN READ MODE ONLY
;
IF FAILURE ;IF FILE OPEN FAILS DISPLAY ERR MSG
ERRORMSG "Couldn't open :%s!" szFile "For Input"
EXIT ;EXIT SCRIPT
ENDIF
;
WHILE 1 ;LOOP FOREVER
FFLUSH 1
FGETS 1 szLine ;Get a line from the file and extract the
;
IF FEOF 1 ;IF EOF REACHED ..
EXITWHILE ;JUMP OUT OF WHILE LOOP
ENDIF
; Seperate the field data
;
strtok szMbxno szLine "|" 1 ; Mailbox number
strtok szUsername szLine "|" 1 ; Users Name has a comma in it
strtok szDeptcd szLine "|" 1 ; Department code
strtok szPasscode szLine "|" 1 ; Temporary Passcode
strtok szDL0101 szLine "|" 1 ; Dist list 01 member 01
strtok szDL0102 szLine "|" 1 ; Dist list 01 member 02
strtok szDL0103 szLine "|" 1 ; Dist list 01 member 03
strtok szDL0104 szLine "|" 1 ; Dist list 01 member 04
;
; Need to check for null values for members 2 to 4. The dlist members could be 1 to 4.
; If there are less than 4, then do not need the action to create dlist entries for those.
;
; End of the line of data needed
;
; To create the mailbox data
; Now to create the Distribution List 01 entry, member 01
;
TRANSMIT "dcreate m1=" ; QNX batch mode command
TRANSMIT szMbxno ; From file mailbox NUMBER
TRANSMIT " dl=1 dm=" ; dlist 1, member is...
TRANSMIT szDL0101 ; Member = Shared Ext MB number
; TRANSMIT "-s" ; Dist list is to be sorted
; Default is Unsorted list
TRANSMIT " +c -v ^M" ; Chk for dup and do not show detail then SEND CARRIAGE RETURN
WAITFOR "#" 10 ; WAIT 10 SECONDS FOR COMMAND COMPLETION
TRANSMIT "^M" ; SEND 2nd CARRIAGE RETURN to force # back
Pause 1 ; pause 1 second
;
; Now to create the Distribution List 01 entry, member 02
;
TRANSMIT "dcreate m1=" ; QNX batch mode command
TRANSMIT szMbxno ; From file mailbox NUMBER
TRANSMIT " dl=1 dm=" ; dlist 1, member is...
TRANSMIT szDL0102 ; Member = Shared Ext MB number
; TRANSMIT "-s" ; Dist list is to be sorted
; Default is Unsorted list
TRANSMIT " +c -v ^M" ; Chk for dup and do not show detail then SEND CARRIAGE RETURN
WAITFOR "#" 10 ; WAIT 10 SECONDS FOR COMMAND COMPLETION
TRANSMIT "^M" ; SEND 2nd CARRIAGE RETURN to force # back
Pause 1 ; pause 1 second
;
; Now to create the Distribution List 01 entry, member 03
;
TRANSMIT "dcreate m1=" ; QNX batch mode command
TRANSMIT szMbxno ; From file mailbox NUMBER
TRANSMIT " dl=1 dm=" ; dlist 1, member is...
TRANSMIT szDL0103 ; Member = Shared Ext MB number
; TRANSMIT "-s" ; Dist list is to be sorted
; Default is Unsorted list
TRANSMIT " +c -v ^M" ; Chk for dup and do not show detail then SEND CARRIAGE RETURN
WAITFOR "#" 10 ; WAIT 10 SECONDS FOR COMMAND COMPLETION
TRANSMIT "^M" ; SEND 2nd CARRIAGE RETURN to force # back
Pause 1 ; pause 1 second
;
; Now to create the Distribution List 01 entry, member 04
;
TRANSMIT "dcreate m1=" ; QNX batch mode command
TRANSMIT szMbxno ; From file mailbox NUMBER
TRANSMIT " dl=1 dm=" ; dlist 1, member is...
TRANSMIT szDL0104 ; Member = Shared Ext MB number
; TRANSMIT "-s" ; Dist list is to be sorted
; Default is Unsorted list
TRANSMIT " +c -v ^M" ; Chk for dup and do not show detail then SEND CARRIAGE RETURN
WAITFOR "#" 10 ; WAIT 10 SECONDS FOR COMMAND COMPLETION
TRANSMIT "^M" ; SEND 2nd CARRIAGE RETURN to force # back
Pause 1 ; pause 1 second
;
;
;******************************************************************
; Created the required data for a Mailbox, get more data input *
;******************************************************************
; end of the mailbox on to the next
CALL CMD_PMPT ;WAIT FOR # PROMPT LOOP
;
ENDWHILE
;
FCLOSE 1 ;CLOSE THE FILE
CALL CMD_PMPT ;WAIT FOR 6.0 # PROMPT LOOP
TRANSMIT "date^M" ;EXIT QNX OPERATING SYSTEM
;
; Show System Time, would be at QNX prompt now.
;
usermsg "End of script, either setup to run the next required Script or exit Procomm"
;
; Inform User that the Script is completed
;
ENDPROC