👨💻 Technical ACs (Gherkin)
Context: ISCOM structure exists with a SIT version field and CCCOM structure contains common area data
GIVEN
ISCOM structure exists with a SIT version field and CCCOM structure contains common area data
Applied to: 1:Version Check and Data Transfer
WHEN
The SIT version in ISCOM matches the working storage ISCOM version
THEN
Copy common area from CCCOM to ISCOM and update ISCOM SIT version to working storage version
Context: ISCOM structure exists with incompatible SIT version and CCCOM structure contains source data
GIVEN
ISCOM structure exists with incompatible SIT version and CCCOM structure contains source data
Applied to: 2:ISCOM Initialization
WHEN
The SIT version in ISCOM does not match the working storage ISCOM version
THEN
Initialize ISCOM with default values from ISCOMVAL, copy common area from CCCOM, and update SIT version
Context: CCCOM and ISCOM structures require cross-referencing for communication
GIVEN
CCCOM and ISCOM structures require cross-referencing for communication
Applied to: 3:Cross-Reference Address Setup
WHEN
ISCOM version mismatch triggers full initialization process
THEN
Set CCCOM address in ISCOM structure and set ISCOM address in CCCOM structure
Context: CCCOM contains LT-PCBS information and ISCOM requires PCB data
GIVEN
CCCOM contains LT-PCBS information and ISCOM requires PCB data
Applied to: 4:PCB Transfer
WHEN
Full ISCOM initialization is required due to version mismatch
THEN
Copy LT-PCBS data from CCCOM to ISCOM structure
Context: CCCOM table contains database entries with names and CCCOM-TABLE-SIZE defines maximum entries
GIVEN
CCCOM table contains database entries with names and CCCOM-TABLE-SIZE defines maximum entries
Applied to: 5:Database Name Scanning
WHEN
Database address scanning is initiated during ISCOM initialization
THEN
Process each CCCOM entry from position 1 until reaching table size limit or finding empty database name
Context: CCCOM entry contains database number field that may be empty or contain spaces
GIVEN
CCCOM entry contains database number field that may be empty or contain spaces
Applied to: 6:PCB Number Processing
WHEN
Processing a CCCOM database entry during scanning
THEN
Initialize ISCOM PCB number to zero, copy database number from CCCOM, and if database number is spaces then set CCCOM PCB number to '1'
Context: CCCOM entry has database name and ISCOM table contains database entries with names
GIVEN
CCCOM entry has database name and ISCOM table contains database entries with names
Applied to: 7:Database Name Matching
WHEN
Scanning ISCOM table for matching database names during address mapping
THEN
Process each ISCOM entry from position 1 until reaching table size limit or finding empty database name
Context: CCCOM database name matches ISCOM database name during scanning process
GIVEN
CCCOM database name matches ISCOM database name during scanning process
Applied to: 8:PCB Counter Management
WHEN
Database names are identical between CCCOM entry and ISCOM entry
THEN
Increment ISCOM PCB number by 1
Context: ISCOM PCB number equals CCCOM PCB number for matching database names
GIVEN
ISCOM PCB number equals CCCOM PCB number for matching database names
Applied to: 9:PCB Address Mapping
WHEN
PCB numbers match after incrementing ISCOM PCB counter
THEN
Set PCB address in ISCOM entry to match PCB address from corresponding CCCOM entry
Context: CCCOM structure exists with SIT version field and ISCOM structure contains source data
GIVEN
CCCOM structure exists with SIT version field and ISCOM structure contains source data
Applied to: 10:Reverse Conversion Version Check
WHEN
Reverse conversion entry point is accessed and CCCOM SIT version matches working storage CCCOM version
THEN
Copy common area from ISCOM to CCCOM and update CCCOM SIT version to working storage version
Context: CCCOM SIT version does not match working storage version and ISCOM contains source data
GIVEN
CCCOM SIT version does not match working storage version and ISCOM contains source data
Applied to: 11:Reverse Data Transfer
WHEN
Reverse conversion is initiated with version mismatch
THEN
Copy common area from ISCOM to CCCOM and update CCCOM SIT version to working storage version
Context: ISCOM contains LT-PCBS information and CCCOM requires PCB data during reverse conversion
GIVEN
ISCOM contains LT-PCBS information and CCCOM requires PCB data during reverse conversion
Applied to: 12:Reverse PCB Transfer
WHEN
CCCOM version mismatch triggers full reverse initialization
THEN
Copy LT-PCBS data from ISCOM to CCCOM structure and set up cross-reference addresses
Context: ISCOM table contains entries with PCB address fields that may be zero or non-zero
GIVEN
ISCOM table contains entries with PCB address fields that may be zero or non-zero
Applied to: 13:Active PCB Identification
WHEN
Scanning ISCOM entries during reverse conversion process
THEN
Process only entries where PCB address is not equal to zero
Context: ISCOM entry has non-zero PCB address and database name
GIVEN
ISCOM entry has non-zero PCB address and database name
Applied to: 14:PCB Sequence Numbering
WHEN
Processing active ISCOM entry during reverse conversion
THEN
Initialize ISCOM PCB number to 1 and count matching database names in previous entries to determine sequence number
Context: Active ISCOM entry contains database name and PCB information
GIVEN
Active ISCOM entry contains database name and PCB information
Applied to: 15:Database Entry Creation
WHEN
Processing ISCOM entry with non-zero PCB address during reverse conversion
THEN
Increment CCCOM entry counter and copy database name from ISCOM to CCCOM entry
Context: ISCOM entry contains PCB address and corresponding CCCOM entry has been created
GIVEN
ISCOM entry contains PCB address and corresponding CCCOM entry has been created
Applied to: 16:Reverse PCB Address Mapping
WHEN
Creating CCCOM database entry from active ISCOM entry
THEN
Set PCB address in CCCOM entry to match PCB address from ISCOM entry
Context: ISCOM PCB number has been calculated for database entry and CCCOM entry requires database number
GIVEN
ISCOM PCB number has been calculated for database entry and CCCOM entry requires database number
Applied to: 17:Database Number Assignment
WHEN
Finalizing CCCOM database entry creation during reverse conversion
THEN
If ISCOM PCB number equals '1' then set CCCOM database number to spaces, otherwise set CCCOM database number to ISCOM PCB number value
Context: A message processing operation is initiated
GIVEN
A message processing operation is initiated
Applied to: 1:Initialize Program Control
WHEN
The system begins message processing
THEN
The current program name is saved and the module name becomes the active program identifier
Context: A new IH notification needs to be processed
GIVEN
A new IH notification needs to be processed
Applied to: 2:Prepare IH Notification Data
WHEN
The notification data structure is being prepared
THEN
The input structure is initialized and security byte is set to high values for maximum security
Context: IH notification data is prepared with security controls
GIVEN
IH notification data is prepared with security controls
Applied to: 3:Format CCN Status Message
WHEN
The CCN status message is being formatted
THEN
The 91-byte input data is moved to positions 2-91 of the message structure and the formatted input is copied to the message area
Context: A CCN status message is formatted and ready for processing
GIVEN
A CCN status message is formatted and ready for processing
Applied to: 3:Format CCN Status Message
WHEN
The message is prepared for transmission
THEN
The accept status is set to spaces to indicate a cleared/ready state
Context: A formatted CCN status message with cleared accept status
GIVEN
A formatted CCN status message with cleared accept status
Applied to: 4:Send Initial IMS Message
WHEN
The message is sent for initial processing
THEN
The CIMS service is invoked with change operation parameters to process the message
Context: A message has been processed through initial IMS processing
GIVEN
A message has been processed through initial IMS processing
Applied to: 5:Write Message Log
WHEN
The message logging is performed
THEN
The WRITMSGL service is invoked with message code, content, length, and module name for complete audit logging
Context: A message has been processed and logged successfully
GIVEN
A message has been processed and logged successfully
Applied to: 6:Purge IMS Message
WHEN
The cleanup operation is performed
THEN
The CIMS service is invoked with purge operation to remove the processed message from the system
Context: A user requests a database operation with a function code
GIVEN
A user requests a database operation with a function code
Applied to: 4:Set SSA Type for Get Operations
WHEN
The function code is GHU (Get Hold Unique) or GU (Get Unique)
THEN
The system sets accept status to GE and configures qualified SSA for precise record targeting
Applied to: 5:Set SSA Type for Next Operations
WHEN
The function code is GHN, GHNP, GN, or GNP (sequential navigation operations)
THEN
The system sets accept status to GAGBGEGK and determines SSA qualification based on unqualified SSA flag setting
Applied to: 6:Set SSA Type for Insert Operations
WHEN
The function code is ISRT (Insert)
THEN
The system sets accept status to II and configures unqualified SSA for record insertion
Applied to: 7:Set SSA Type for Update/Delete Operations
WHEN
The function code is DLET (Delete) or REPL (Replace)
THEN
The system configures no SSA requirement for the modification operation
Applied to: 3:Validate Function Code
WHEN
The function code is not GHU, GU, GHN, GHNP, GN, GNP, ISRT, DLET, or REPL
THEN
The system marks the operation as not valid and prevents further processing
Context: A validated operation targets the root segment GCSTBRT
GIVEN
A validated operation targets the root segment GCSTBRT
Applied to: 8:Initialize Root Segment SSA
WHEN
The SSA flag indicates qualified search is required
THEN
The system sets the root segment key value for targeted access
Context: A validated operation targets the dependent segment GCSTBDP with qualified SSA
GIVEN
A validated operation targets the dependent segment GCSTBDP with qualified SSA
Applied to: 9:Initialize Dependent Segment SSA
WHEN
The unqualified SSA flag is not set
THEN
The system sets both root segment key value and dependent segment key value for hierarchical access
Context: A validated operation targets the dependent segment GCSTBDP
GIVEN
A validated operation targets the dependent segment GCSTBDP
Applied to: 10:Handle Dependent Segment Unqualified Access
WHEN
Either the unqualified SSA flag is set or the SSA flag indicates unqualified search
THEN
The system sets only the root segment key value and configures unqualified SSA for broader search scope
Context: A validated operation specifies a segment name
GIVEN
A validated operation specifies a segment name
Applied to: 9:Initialize Dependent Segment SSA
WHEN
The segment name is neither GCSTBRT (root) nor GCSTBDP (dependent)
THEN
The system marks the operation as not valid and prevents database access
Context: A validated operation targets the root segment with initialized SSA
GIVEN
A validated operation targets the root segment with initialized SSA
Applied to: 11:Route Root Segment Access
WHEN
The operation is ready for database access
THEN
The system routes to primary PCB if second PCB flag is not set, otherwise routes to secondary PCB
Context: A validated operation targets the dependent segment with initialized SSA
GIVEN
A validated operation targets the dependent segment with initialized SSA
Applied to: 14:Route Dependent Segment Access
WHEN
The operation is ready for database access
THEN
The system routes to primary PCB if second PCB flag is not set, otherwise routes to secondary PCB
Context: A root segment operation is routed to primary PCB
GIVEN
A root segment operation is routed to primary PCB
Applied to: 12:Execute Root Segment Database Call with Primary PCB
WHEN
The SSA configuration determines the call parameters
THEN
The system calls CIMS with appropriate SSA parameters: qualified SSA for targeted access, unqualified SSA for broader access, or no SSA for direct operations
Context: A root segment operation is routed to secondary PCB
GIVEN
A root segment operation is routed to secondary PCB
Applied to: 13:Execute Root Segment Database Call with Secondary PCB
WHEN
The SSA configuration determines the call parameters
THEN
The system calls CIMS with secondary PCB and appropriate SSA parameters: qualified SSA for targeted access, unqualified SSA for broader access, or no SSA for direct operations
Context: A dependent segment operation is routed to primary PCB
GIVEN
A dependent segment operation is routed to primary PCB
Applied to: 15:Execute Dependent Segment Database Call with Primary PCB
WHEN
The SSA configuration determines the call parameters
THEN
The system calls CIMS with hierarchical SSA parameters: both root and dependent qualified SSAs for targeted access, root qualified and dependent unqualified SSAs for mixed access, or no SSA for direct operations
Context: A dependent segment operation is routed to secondary PCB
GIVEN
A dependent segment operation is routed to secondary PCB
Applied to: 16:Execute Dependent Segment Database Call with Secondary PCB
WHEN
The SSA configuration determines the call parameters
THEN
The system calls CIMS with secondary PCB and hierarchical SSA parameters: both root and dependent qualified SSAs for targeted access, root qualified and dependent unqualified SSAs for mixed access, or no SSA for direct operations
Context: A database operation has been executed through CIMS
GIVEN
A database operation has been executed through CIMS
Applied to: 17:Evaluate Operation Success
WHEN
The operation completes and returns a status code
THEN
The system sets return flag to SUCCESSFUL if status code is spaces, otherwise sets return flag to UNSUCCESSFUL
Context: A cargo processing request is received with a segment name
GIVEN
A cargo processing request is received with a segment name
Applied to: 1:Parameter Validation
WHEN
The segment name is not one of GCSUSRT, GCSA2RT, GCSA8RT, or GCST2RT
THEN
The system rejects the request with error code 0012 and message 'SEGMENT NAME INVALID'
Context: A cargo processing request is received with a function code
GIVEN
A cargo processing request is received with a function code
Applied to: 1:Parameter Validation
WHEN
The function code is not GU, GN, ISRT, REPL, or DLET
THEN
The system rejects the request with error code 0012 and message 'FUNCTION CODE INVALID'
Context: A request targets GCST2RT segment
GIVEN
A request targets GCST2RT segment
Applied to: 1:Parameter Validation
WHEN
The function code is not GU (Get Unique)
THEN
The system rejects the request with error code 0012 and message 'INVALID FUNCTION CODE'
Context: A cargo processing request is received
GIVEN
A cargo processing request is received
Applied to: 1:Parameter Validation
WHEN
The operator field is empty or contains spaces
THEN
The system sets the operator to equals (=) as default
Context: A validated cargo processing request
GIVEN
A validated cargo processing request
Applied to: Segment Type?
WHEN
The segment type is GCSUSRT, GCSA2RT, GCSA8RT, or GCST2RT
THEN
The system routes to primary, secondary, message, or table processing respectively
Context: A cargo record modification request
GIVEN
A cargo record modification request
Applied to: Function Code?
WHEN
The function code is ISRT, DLET, REPL, or ZAP
THEN
The system sets the update-by-module field to the current transaction code
Context: A new cargo record is being inserted
GIVEN
A new cargo record is being inserted
Applied to: 2:Primary Cargo Record Insert
WHEN
The creation timestamp field is empty
THEN
The system sets creation date, time, terminal, and user ID from current system values and copies to last-modify fields
Context: A cargo record is being inserted
GIVEN
A cargo record is being inserted
Applied to: 2:Primary Cargo Record Insert
WHEN
The creation timestamp field already contains data
THEN
The system updates only the last-modify date, time, terminal, and user ID with current system values
Context: A cargo record index update is requested
GIVEN
A cargo record index update is requested
Applied to: 6:Index Field Management
WHEN
The cargo status indicates the record is deleted
THEN
The system skips all index field setting operations
Context: A cargo record requires bond number indexing
GIVEN
A cargo record requires bond number indexing
Applied to: 18:Bond Control Number Processing
WHEN
In-bond control number exists, use it; else if entry number exists, use entry number; else set to spaces
THEN
The system sets the bond index field according to the priority hierarchy
Context: A cargo record deletion is requested
GIVEN
A cargo record deletion is requested
Applied to: 4:Primary Cargo Record Delete
WHEN
The delete operation is initiated
THEN
The system retrieves the record, blanks index fields, sets status to DELETED, and updates the record
Context: A cargo record replacement is requested
GIVEN
A cargo record replacement is requested
Applied to: 3:Primary Cargo Record Update
WHEN
The replace operation is performed
THEN
The system updates last-modify date, time, terminal, and user ID with current system values
Context: A cargo record status update is processed
GIVEN
A cargo record status update is processed
Applied to: 14:GCSB1RT Index Database Management
WHEN
The cargo has no error conditions and no hold conditions (HOLD, HOLDPCS, PR-HPCS, HOLD-B, PR-H-BO, HOLD-D, PR-H-DE, HOLDFDA)
THEN
The system deletes the cargo record from the GCSB1RT status index
Context: A cargo record has error or pending status
GIVEN
A cargo record has error or pending status
Applied to: 14:GCSB1RT Index Database Management
WHEN
The cargo status indicates CPCARGO-ERROR, CPCARGO-PENDING, or USCARGO-ERROR
THEN
The system fills error fields and either updates existing status record or inserts new status record
Context: A cargo record has hold status
GIVEN
A cargo record has hold status
Applied to: 14:GCSB1RT Index Database Management
WHEN
The cargo status indicates any hold condition (HOLD, HOLDPCS, PR-HPCS, HOLD-B, PR-H-BO, HOLD-D, PR-H-DE, HOLDFDA)
THEN
The system fills hold fields and either updates existing status record or inserts new status record
Context: A cargo search request with secondary index specified
GIVEN
A cargo search request with secondary index specified
Applied to: 8:Secondary Index Processing
WHEN
The index type is CAR-ID, WAYBILL, CAR-WB, BOND, MANIFEST, DEST, LEAD-CCN, HELD-DEST, HELD-BORDER, ERR-ORIG, ERR-BORDER, or ERR-DEST
THEN
The system routes to the appropriate index processing for that search type
Context: A secondary cargo data operation is requested
GIVEN
A secondary cargo data operation is requested
Applied to: 11:Secondary Database Processing
WHEN
For REPL function: if record exists and new data is empty, delete; if record exists and new data has content, replace; if record not found and new data has content, insert
THEN
The system performs the appropriate database operation based on the content and existence logic
Context: A cargo status change triggers notification processing
GIVEN
A cargo status change triggers notification processing
Applied to: 15:Iron Highway Notification Processing
WHEN
Both US cargo status and CP cargo status are empty, or the status matches the previous notification, or the status is RELEASE
THEN
The system skips sending the notification
Context: A cargo status notification is being prepared
GIVEN
A cargo status notification is being prepared
Applied to: 15:Iron Highway Notification Processing
WHEN
US cargo status is empty and CP status is SENT, use SENT; for DELETED or RELEASE status, always process; otherwise use US cargo short description
THEN
The system selects the appropriate status value according to the priority rules
Context: A cargo status code needs to be displayed or processed
GIVEN
A cargo status code needs to be displayed or processed
Applied to: 7:Cargo Status Description Setting
WHEN
The internal status is OK, PENDING, ACKNWLG, ERROR, SENT, DELETED, DELPEND, RELSD, ARRIVAL, AARR, EXPORT, AEXP, IMED-EX, or XFERED
THEN
The system maps to corresponding business descriptions: OK, PENDING, ACK, ERROR, SENT, DELETED, DELPEND, RELEASED, MNL-ARRV, AUT-ARRV, MNL-EXP, AUT-EXP, IMED-EXP, XFERED respectively
Context: A secondary segment retrieval operation is requested
GIVEN
A secondary segment retrieval operation is requested
Applied to: 11:Secondary Database Processing
WHEN
The function is GU or GN and the secondary key is empty or spaces
THEN
The system returns error code 0012 with message 'SECN-KEY EQUAL SPACES'
Context: A GCSA8RT message segment retrieval operation is requested
GIVEN
A GCSA8RT message segment retrieval operation is requested
Applied to: 12:GCSA8RT Message Processing
WHEN
The function is GU or GN and the GCSA8RT key is empty or spaces
THEN
The system returns error code 0012 with message 'GCSA8RT-KEY EQUAL SPACES'
Context: A GCSA8RT message segment insert operation is requested
GIVEN
A GCSA8RT message segment insert operation is requested
Applied to: 12:GCSA8RT Message Processing
WHEN
A record with the same key already exists, perform replace operation; if no existing record, perform insert operation
THEN
The system executes the appropriate database operation and restructures the message data format
Context: A cargo notification requires shipment reference information
GIVEN
A cargo notification requires shipment reference information
Applied to: 16:Reference Number Processing
WHEN
N9 reference segments exist for the cargo with qualifier 'CN'
THEN
The system extracts the reference number as shipment ID for the notification
Context: A cargo operation requires station or border information
GIVEN
A cargo operation requires station or border information
Applied to: 19:Station Code Processing
WHEN
The system needs to resolve location codes to station numbers
THEN
The system retrieves station information from GCSTBRT table segments using location ID
Context: A cargo status change is requested
GIVEN
A cargo status change is requested
Applied to: 20:Cargo Status Transition Management
WHEN
The new status represents a valid business transition from the current status
THEN
The system updates the cargo status and triggers appropriate downstream processing including notifications and index updates
Context: The error processing program starts execution
GIVEN
The error processing program starts execution
Applied to: 4:Common Error Processing - Call DCCCOM
WHEN
The program begins error handling workflow
THEN
The common communication area CCCOM is initialized through DCCCOM service
Context: The common communication area has been initialized
GIVEN
The common communication area has been initialized
Applied to: 3:Dump Only Check - WS-DUMP-ONLY?
WHEN
The system checks the dump-only mode flag WS-DUMP-ONLY
THEN
If WS-DUMP-ONLY is true, skip environment-specific error handling and proceed directly to error notification; if WS-DUMP-ONLY is false, continue with environment detection
Context: The system is not in dump-only mode and environment detection is required
GIVEN
The system is not in dump-only mode and environment detection is required
Applied to: 2:Environment Detection - CC-PROD-TEST-IMS = WS-PROD?
WHEN
The system compares CC-PROD-TEST-IMS with WS-PROD value
THEN
If CC-PROD-TEST-IMS equals WS-PROD, route to production error handling; otherwise route to test error handling
Context: The system has detected production environment (CC-PROD-TEST-IMS equals WS-PROD)
GIVEN
The system has detected production environment (CC-PROD-TEST-IMS equals WS-PROD)
Applied to: 5:Production Error Handling - Call CERRPROD
WHEN
Production error handling is required
THEN
The CERRPROD service is invoked with CCCOM communication area to handle production-specific error processing
Context: The system has detected test environment (CC-PROD-TEST-IMS does not equal WS-PROD)
GIVEN
The system has detected test environment (CC-PROD-TEST-IMS does not equal WS-PROD)
Applied to: 6:Test Error Handling - Call CERRTEST
WHEN
Test error handling is required
THEN
The CERRTEST service is invoked with CCCOM communication area to handle test-specific error processing
Context: Error processing has completed (either environment-specific handling or dump-only mode)
GIVEN
Error processing has completed (either environment-specific handling or dump-only mode)
Applied to: 7:Error Notification Display - Display blocking error message
WHEN
Error notification is required
THEN
Display blocking error message with header and footer delimiters to system error output (SYSERR)
Context: All error processing steps and notifications have been completed
GIVEN
All error processing steps and notifications have been completed
Applied to: 8:Program Termination - Return control
WHEN
The error processing workflow reaches completion
THEN
Return control to the calling program using GOBACK statement
Context: A CIMS program is invoked with linkage parameters
GIVEN
A CIMS program is invoked with linkage parameters
Applied to: 1:Parameter Address Linkage Setup
WHEN
The system processes the parameter count and argument addresses
THEN
Memory addresses are established for CCCOM, FUNC, and ADDR-AREA parameters and the argument count is stored for subsequent processing
Context: Parameter addresses are established and argument count is available
GIVEN
Parameter addresses are established and argument count is available
Applied to: 2:Function and SSA Parameter Processing
WHEN
The system processes parameters 4 through 10 representing IO-AREA and SSA1 through SSA6
THEN
Function code is stored in CCCOM last IMS function, SSA parameters are mapped to their respective addresses and stored in CCCOM last SSA fields, and IO-AREA address is established when 4 or more arguments are provided
Context: CCCOM ISCOM address is not null and not blank pointer
GIVEN
CCCOM ISCOM address is not null and not blank pointer
Applied to: 3:ISCOM Address Validation
WHEN
The system checks ISCOM address availability
THEN
ISCOM address is established for subsequent processing
Context: CCCOM structure is available with version information
GIVEN
CCCOM structure is available with version information
Applied to: 4:CCCOM Version Compatibility Check
WHEN
The system compares CCCOM SIT version with working storage CCCOM version
THEN
ISCOM compatibility check is performed only when versions match
Context: ADDR-AREA is not null, PCB address is valid, CCCOM version is compatible, and PCB copy is available
GIVEN
ADDR-AREA is not null, PCB address is valid, CCCOM version is compatible, and PCB copy is available
Applied to: 5:PCB Address Reset Logic
WHEN
Segment level is not '98' or '99' OR force reset flag is true
THEN
First 8 positions of ADDR-AREA are cleared with spaces
Context: PCB address is null or blank pointer
GIVEN
PCB address is null or blank pointer
Applied to: 6:PCB Address Resolution
WHEN
The system searches through up to 249 database name entries
THEN
Search continues until valid PCB address is found, maximum entries reached, or database name entry is spaces, and matching PCB address is retrieved when database name matches table entry
Context: PCB address resolution process is completed
GIVEN
PCB address resolution process is completed
Applied to: 7:PCB Address Validation
WHEN
PCB address remains null after resolution attempts
THEN
Error message is generated with PCB name and number information and error handling routine CERR is invoked
Context: Valid PCB address exists, function code is available, and all SSA parameters are processed
GIVEN
Valid PCB address exists, function code is available, and all SSA parameters are processed
Applied to: 8:IMS Function Call Execution
WHEN
The system invokes CBLTDLI with function, PCB copy, IO area, and SSA parameters
THEN
IMS database operation is executed and control returns with status information in PCB
Context: IMS function call is completed
GIVEN
IMS function call is completed
Applied to: 9:IO PCB Date Time Refresh
WHEN
Function is 'GU' (Get Unique) AND PCB address equals CCCOM IO PCB address
THEN
IMS call counter is reset to zero, current system date is obtained and stored in CCCOM machine century and date fields, and current system time is captured and stored in CCCOM machine time field
Context: IMS function call is executed
GIVEN
IMS function call is executed
Applied to: 10:IMS Call Counter Management
WHEN
Any IMS database operation is performed
THEN
IMS call counter in CCCOM is incremented by 1
Context: IMS call counter is updated and PCB copy is available
GIVEN
IMS call counter is updated and PCB copy is available
Applied to: 11:PCB Status Information Update
WHEN
PCB information needs to be synchronized with CCCOM
THEN
PCB copy is moved to CCCOM copy of PCB field and feedback key length is updated in CCCOM when segment level is not '98' or '99'
Context: PCB status information is updated
GIVEN
PCB status information is updated
Applied to: 12:Terminal and User Information Capture
WHEN
Function is 'GU' (Get Unique) OR 'CHKP' (Checkpoint) AND PCB address equals CCCOM IO PCB address
THEN
CCCOM LTERM name is copied to CCCOM original LTERM field and CCCOM user ID is copied to CCCOM ACF2 user ID field
Context: IMS operation is completed with status code in CCCOM
GIVEN
IMS operation is completed with status code in CCCOM
Applied to: 13:Status Code Validation
WHEN
Status code is not blank (spaces)
THEN
Status code is compared against up to 12 acceptable status codes in CCCOM acceptable status table
Context: Status code validation is completed
GIVEN
Status code validation is completed
Applied to: 14:Error Message Generation
WHEN
Status code is not found in acceptable status code table after checking all 12 entries
THEN
Error message is constructed with status code and 'IMS RC CODE NOT IN ACCEPTABLE LIST' text, error message is stored in CCCOM error message field, and error handling routine CERR is invoked
Context: IMS operation completed successfully with blank status code OR acceptable status code found
GIVEN
IMS operation completed successfully with blank status code OR acceptable status code found
Applied to: 18:Common Area Synchronization
WHEN
CCCOM ISCOM address is not null and not blank pointer
THEN
CCCOM common area is copied to ISCOM common area to maintain data consistency
Context: The program has started execution
GIVEN
The program has started execution
Applied to: 1:Message Writing Initialization
WHEN
The message writing initialization is triggered
THEN
The basic message writing function WRITMSG is invoked
Context: The basic message writing has been completed and six parameters P1, P2, P3, P4, P5, P6 are available
GIVEN
The basic message writing has been completed and six parameters P1, P2, P3, P4, P5, P6 are available
Applied to: 2:Parameterized Message Writing
WHEN
The parameterized message writing is triggered
THEN
The extended message writing function WRITMSGX is invoked with parameters P1, P2, P3, P4, P5, P6
Context: The program execution begins
GIVEN
The program execution begins
Applied to: Program Start to Program End
WHEN
Message processing workflow is initiated
THEN
Basic message writing must be completed before parameterized message writing, and program terminates after both operations complete
Context: An input error number is provided and an error table exists with error numbers and corresponding text messages
GIVEN
An input error number is provided and an error table exists with error numbers and corresponding text messages
Applied to: Error Code Lookup
WHEN
The system performs a sequential search through the error table starting from index 1 and incrementing by 1
THEN
The search continues until either the input error number matches an error number in the table OR an empty entry (spaces) is encountered indicating end of table
Context: The error table search has completed and the input error number was found in the table
GIVEN
The error table search has completed and the input error number was found in the table
Applied to: Error Message Retrieval
WHEN
The error number at the current index position matches the input error number
THEN
The system moves the corresponding error text from the table to the output message text field
Context: The error table search has completed and the input error number was not found in the table
GIVEN
The error table search has completed and the input error number was not found in the table
Applied to: Unknown Error Handling
WHEN
The error number at the current index position does not match the input error number
THEN
The system moves the input error number to the unknown number field AND moves the unknown message to the output message text field
Context: The program GCX126 starts execution
GIVEN
The program GCX126 starts execution
Applied to: 1:Initialize Program Configuration
WHEN
Initialization is performed
THEN
Set log index to 1, clear remark index, clear log array, clear previous CRN, set all segment flags to not found, set cargo not found flag, initialize line counters, set from usercode to 'OM01247', set accept status to 'GE', initialize all segment structures (M10, P4, V9, K1, X4, N7), retrieve admin table with table ID 'AD' and sequence ID 'ADMINID', if admin segment found then set Merlin recipient to admin DC Merlin 1 value, format machine date and time from system values, initialize date conversion parameters, convert machine date to Julian format, read message queue, connect to MQ manager, and open MQ queue
Context: MQ connection is established and queue is open
GIVEN
MQ connection is established and queue is open
Applied to: 2:Read EDI 350 Message from Queue
WHEN
MQGET operation is performed
THEN
Read message into MQS-MESSAGE buffer, calculate maximum MQS entries as (data length minus header length) divided by entry length rounded, if calculated entries exceed maximum constant then set to maximum constant value
Context: An EDI 350 message has been retrieved from the queue
GIVEN
An EDI 350 message has been retrieved from the queue
Applied to: Message Available? and Message Valid?
WHEN
Message status is evaluated
THEN
If completion code is not OK and reason code is 2033 then set message not available flag, else if completion code is OK and backout count is not zero then set skip message flag, else if completion code is OK and maximum MQS entries is less than 1 then abort with error 'USER ABEND 350 MESSAGE TOO SHORT', else if completion code is OK and backout count is zero then set good message found flag, else set end of queue flag
Context: A valid EDI 350 message has been loaded
GIVEN
A valid EDI 350 message has been loaded
Applied to: 3:Determine Message Type
WHEN
Message header is examined
THEN
If MQS cross-way header positions 1 through 10 equal '+++3505040' then set conveyance 350 flag to true, else set cargo 350 flag to true
Context: Message has been validated and type determined
GIVEN
Message has been validated and type determined
Applied to: 4:Parse EDI Segments and Segment Type?
WHEN
Each message line is processed
THEN
If table ID is 'ST' then set header found and first X4 flags, else if table ID is 'M10' then perform M10 segment processing, else if table ID is 'P4' then perform P4 segment processing, else if table ID is 'V9' then perform V9 segment processing, else if table ID is 'VID' then continue, else if table ID is 'K1' then perform K1 segment processing, else if table ID is 'X4' then initialize K1 comments and perform X4 segment processing, else if table ID is 'N7' then perform N7 segment processing, else if table ID is 'SE' then set trailer found and end found flags and perform rest of message processing
Context: Message line contains M10 segment identifier
GIVEN
Message line contains M10 segment identifier
Applied to: 5:Process M10 Notice Segment
WHEN
M10 segment is processed
THEN
Set M10 segment found flag to true, initialize M10 segment structure, and move table entry to M10 segment structure
Context: Message line contains P4 segment identifier
GIVEN
Message line contains P4 segment identifier
Applied to: 6:Process P4 Port Segment
WHEN
P4 segment is processed
THEN
Set P4 segment found flag to true, initialize P4 segment structure, and move table entry to P4 segment structure
Context: Message line contains V9 segment identifier
GIVEN
Message line contains V9 segment identifier
Applied to: 7:Process V9 Notice Reason Segment
WHEN
V9 segment is processed
THEN
Set V9 segment found flag to true, initialize V9 segment structure, and move table entry to V9 segment structure
Context: Message line contains K1 segment identifier
GIVEN
Message line contains K1 segment identifier
Applied to: 8:Process K1 Remarks Segment
WHEN
K1 segment is processed
THEN
Set K1 segment found flag to true, initialize K1 segment structure, move table entry to K1 segment structure, add 1 to K1 remark index, if K1 remark index exceeds maximum (50) then set index to maximum value, else move K1 segment to K1 remark array at current index position
Context: Message line contains N7 segment identifier
GIVEN
Message line contains N7 segment identifier
Applied to: 9:Process N7 Equipment Segment
WHEN
N7 segment is processed
THEN
Set N7 segment found flag to true, initialize N7 segment structure, move table entry to N7 segment structure, if N7 equipment number is not spaces then move equipment number to log data at current log index with type 'EDI 350 EQP#:' and add 1 to log index
Context: X4 segment is being processed and entry type code is '992' and conveyance 350 flag is true
GIVEN
X4 segment is being processed and entry type code is '992' and conveyance 350 flag is true
Applied to: 10:Process Conveyance 350 Train Arrival and Train Found?
WHEN
X4 segment processing is performed
THEN
If X4 release document ID positions 1 through 25 equal previous CRN then continue, else move X4 release document ID positions 1 through 25 to B4 key value and previous CRN, perform train lookup by CRN, if train not found (status code not spaces) then prepare unknown train error message with CRN, set line count to 4, set message type to unknown, and perform email send preparation, else if train found then move log information, format date and time from machine values, set action code to 'ZZZ', move CRN to train or US CCN field, set cargo type to CA train, set message to '350 ACK - ARRIVAL ACK AT BORDER', and spawn log entry
Context: Train has been validated and X4 CBSA release reference ID positions 1 through 25 are moved to cargo key value
GIVEN
Train has been validated and X4 CBSA release reference ID positions 1 through 25 are moved to cargo key value
Applied to: 11:Update Cargo Border Arrival Status
WHEN
Cargo border update is performed
THEN
Perform cargo lookup by CCN, if cargo is found then set message to '350 ACK - ARRIVAL ACK AT BORDER', move cargo CCN key to current CCN key, perform log cargo info message, set cargo border arrival acknowledgment flag to true, clear status code, set accept status to spaces, and replace cargo record
Context: Cargo has been updated with border arrival and cargo is master manifest type
GIVEN
Cargo has been updated with border arrival and cargo is master manifest type
Applied to: 12:Process Master Manifest Border Arrival
WHEN
Master manifest processing is performed
THEN
Move cargo CCN key to B0 CCN key, clear follower manifest array, set follower not end of database flag, set index to 1, perform until follower end of database or index exceeds 100: set accept status to 'GEGB', call database with get next function for cargo using B0 qualifier, if status code is spaces and master manifest CCN equals X4 CBSA release reference ID positions 1 through 25 then if cargo is follower manifest then move cargo CCN key to follower manifest array at index position and add 1 to index, else set follower end of database flag, subtract 1 from index, if index is less than or equal to zero then exit, else perform varying index from 1 by 1 until follower manifest at index is spaces or low values or index exceeds limit: move follower manifest CCN to cargo key value, perform cargo lookup, if cargo found then perform cargo border update
Context: Train lookup by CRN has failed (status code is not spaces)
GIVEN
Train lookup by CRN has failed (status code is not spaces)
Applied to: 13:Send Train Not Found Error
WHEN
Error notification is prepared
THEN
Clear detail line 1, concatenate 'UNKNOWN TRAIN ENTRY IN EDI 350 ' with X4 release document ID positions 1 through 25 into detail line 1, move 'THIS CRN WAS NOT FOUND.' to detail line 3, set line count to 4, set message type to unknown, and perform email send preparation
Context: SE trailer segment has been processed and K1 segment found flag is true
GIVEN
SE trailer segment has been processed and K1 segment found flag is true
Applied to: 14:Log K1 Remarks
WHEN
Rest of message processing is performed
THEN
Perform varying index from 1 by 1 until index exceeds K1 remark index: if K1 remark for X4 at index is not spaces then initialize K1 segment, move K1 remark for X4 at index to K1 segment, clear info message, concatenate 'EDI 350 K1: ' with K1 free form message 1 into info message, perform log cargo info message, if K1 free form message 2 is not spaces then clear info message, concatenate 'EDI 350 K1: ' with K1 free form message 2 into info message, and perform log cargo info message
Context: SE trailer segment has been processed and N7 segment found flag is true
GIVEN
SE trailer segment has been processed and N7 segment found flag is true
Applied to: 15:Log N7 Equipment Information
WHEN
Rest of message processing is performed
THEN
Perform varying log index from 1 by 1 until log line at index is spaces or log index exceeds 50: clear info message, move log line at index to info message, and perform log cargo info message
Context: M10 segment has been processed and contains CCN in positions 1 through 25
GIVEN
M10 segment has been processed and contains CCN in positions 1 through 25
Applied to: 16:Lookup Cargo by CCN
WHEN
Cargo lookup is performed
THEN
Move M10 CCN positions 1 through 25 to cargo key value, set accept status to 'GE', call database with get hold unique function for cargo using cargo qualifier, perform cargo switch setting, if cargo found then set accept status to 'GE' and call database with get hold unique function for cargo secondary using A2 qualifier, if status code is 'GE' then clear cargo secondary segment
Context: Cargo lookup has failed (cargo not found) and V9 notice reason indicates released
GIVEN
Cargo lookup has failed (cargo not found) and V9 notice reason indicates released
Applied to: 17:Handle Unknown Cargo Release
WHEN
Unknown cargo processing is performed
THEN
Clear detail line 1, concatenate 'UNKNOWN EDI 350 RELEASE FROM CBSA ' with M10 CCN positions 1 through 25 into detail line 1, move 'THIS CCN WAS NOT FOUND.' to detail line 3, concatenate 'RELEASE NUMBER: ' with X4 CBSA release reference ID positions 1 through 15, ' DONE BY PORT ' with P4 port code positions 1 through 4 into detail line 4, set line count to 5, set message type to unknown, and perform email send preparation
Context: Cargo lookup has failed (cargo not found) and V9 notice reason indicates deconsolidation
GIVEN
Cargo lookup has failed (cargo not found) and V9 notice reason indicates deconsolidation
Applied to: 18:Handle Unknown Cargo Deconsolidation
WHEN
Unknown cargo processing is performed
THEN
Clear detail line 1, concatenate 'UNKNOWN EDI 350 DCON NOTICE ' with M10 CCN positions 1 through 25 into detail line 1, move 'THIS CCN WAS NOT FOUND.' to detail line 3, concatenate 'HOUSE BILL CLOSE NUMBER' with X4 CBSA release reference ID positions 1 through 25, ' DONE BY PORT ' with P4 port code positions 1 through 4 into detail line 4, set line count to 5, set message type to unknown, and perform email send preparation
Context: Cargo lookup has failed (cargo not found) and V9 notice reason is not released or deconsolidation
GIVEN
Cargo lookup has failed (cargo not found) and V9 notice reason is not released or deconsolidation
Applied to: 19:Handle Unknown Cargo Entry
WHEN
Unknown cargo processing is performed
THEN
Clear detail line 1, concatenate 'UNKNOWN EDI 350 ENTRY FROM CBSA ' with M10 CCN positions 1 through 25 into detail line 1, move 'THIS CCN WAS NOT FOUND.' to detail line 3, concatenate 'NOTICE DOC TYPE: ' with M10 notice document type code, ' WITH REASON CODE ' with V9 notice reason code positions 1 through 4 into detail line 4, set line count to 5, set message type to unknown, and perform email send preparation
Context: Cargo has been found and V9 notice reason indicates not matched
GIVEN
Cargo has been found and V9 notice reason indicates not matched
Applied to: 20:Process Document Not Matched
WHEN
Cargo processing is performed
THEN
Clear info message, move 'EDI 350: DOC NOT MATCHED ' to info message, and perform log cargo info message
Context: Cargo has been found and V9 notice reason indicates cargo complete
GIVEN
Cargo has been found and V9 notice reason indicates cargo complete
Applied to: 21:Process Cargo Complete
WHEN
Cargo processing is performed
THEN
Clear info message, move 'EDI 350: CARGO COMPLETE MESSAGE ' to info message, and perform log cargo info message
Context: Cargo has been found and V9 notice reason indicates document package complete
GIVEN
Cargo has been found and V9 notice reason indicates document package complete
Applied to: 22:Process Document Package Complete
WHEN
Cargo processing is performed
THEN
If X4 CBSA release reference ID positions 1 through 15 not equal cargo broker entry positions 1 through 15 or X4 CBSA release reference ID positions 1 through 14 not equal cargo customs transaction number positions 1 through 14, and X4 CBSA release reference ID is not spaces, then move X4 CBSA release reference ID positions 1 through 15 to cargo broker entry, move X4 CBSA release reference ID positions 1 through 14 to cargo customs transaction number, move machine date to cargo broker date, move machine time positions 1 through 4 to cargo broker time, clear info message, concatenate 'EDI 350: DOC PKG COMPLETE : ' with X4 CBSA release reference ID positions 1 through 15 into info message, perform log cargo info message, and perform cargo replace
Context: Cargo has been found and V9 notice reason indicates document not on file
GIVEN
Cargo has been found and V9 notice reason indicates document not on file
Applied to: 23:Process Document Not On File
WHEN
Cargo processing is performed
THEN
Clear info message, if X4 release document type code position 1 equals 'R' then concatenate 'EDI 350: DOC NOT ON FILE FOR RELEASE ' with X4 CBSA release reference ID positions 1 through 15 into info message and perform log cargo info message, else concatenate 'EDI 350:DOC NOT ON FILE H-BILL CLOSE ' with X4 CBSA release reference ID positions 1 through 25 into info message and perform log cargo info message
Context: Cargo has been found and V9 notice reason indicates reported
GIVEN
Cargo has been found and V9 notice reason indicates reported
Applied to: 24:Process Cargo Reported
WHEN
Cargo processing is performed
THEN
Clear info message, concatenate 'EDI 350: CARGO REPORTED ' into info message, and perform log cargo info message
Context: Cargo has been found and V9 notice reason indicates arrived
GIVEN
Cargo has been found and V9 notice reason indicates arrived
Applied to: 25:Process Cargo Arrived
WHEN
Cargo processing is performed
THEN
Clear info message, concatenate 'EDI 350: CARGO ARRIVED AT PORT ' with P4 port code positions 1 through 4 into info message, and perform log cargo info message
Context: Cargo has been found and V9 notice reason indicates released
GIVEN
Cargo has been found and V9 notice reason indicates released
Applied to: 26:Process Cargo Release
WHEN
Cargo processing is performed
THEN
Perform set release information, clear info message, concatenate 'EDI 350: RELEASE : ' with X4 CBSA release reference ID positions 1 through 15, ' AT PORT ' with P4 port code positions 1 through 4 into info message, concatenate X4 CBSA release reference ID positions 1 through 15, '/' with P4 port code positions 1 through 4 into cargo release reason, perform log cargo info message, perform process US manifest, move cargo release date to hold date, move cargo release time to hold time, perform cargo replace, if cargo is master manifest then save cargo segment, move cargo CCN key to B0 CCN key, set follower not end of database flag, perform process multi follower manifests, restore cargo segment, move cargo waybill key to save waybill index, and move cargo equipment car to current car ID key
Context: Cargo has been found and V9 notice reason indicates authorized to deliver
GIVEN
Cargo has been found and V9 notice reason indicates authorized to deliver
Applied to: 27:Process Authorized to Deliver
WHEN
Cargo processing is performed
THEN
If cargo CSA indicator is on then move 'EDI 350: ACCEPTED - CSA' to info message, perform log cargo info message, set cargo status to CSA delivery, set cargo CSA authorization to deliver received flag to true, and perform cargo replace, else move 'EDI 350: NOT ACCEPTED - NON-CSA' to info message and perform log cargo info message, then perform process US manifest
Context: Cargo has been found and V9 notice reason indicates held
GIVEN
Cargo has been found and V9 notice reason indicates held
Applied to: 28:Process Cargo Hold
WHEN
Cargo processing is performed
THEN
Clear info message, move 'EDI 350: GOODS HELD FOR EXAMINATION' to info message, perform log cargo info message, set cargo status to hold, perform cargo replace, if cargo CCN key positions 1 through 4 equal '6105' then perform Merlin prepare hold notification
Context: Cargo has been found and V9 notice reason indicates deconsolidation
GIVEN
Cargo has been found and V9 notice reason indicates deconsolidation
Applied to: 29:Process Deconsolidation Release
WHEN
Cargo processing is performed
THEN
Perform set release information, clear info message, concatenate 'EDI 350: RELEASE VIA DECON AT PORT ' with P4 port code positions 1 through 4 into info message, concatenate 'DECONSOLIDATION AT ' with P4 port code positions 1 through 4 into cargo release reason, perform log cargo info message, perform process US manifest, move cargo release date to hold date, move cargo release time to hold time, perform cargo replace, if cargo is master manifest then save cargo segment, move cargo CCN key to B0 CCN key, set follower not end of database flag, perform process multi follower manifests, restore cargo segment, move cargo waybill key to save waybill index, and move cargo equipment car to current car ID key
Context: Cargo is being released or deconsolidated
GIVEN
Cargo is being released or deconsolidated
Applied to: 30:Set Release Information
WHEN
Release information setting is performed
THEN
Clear cargo destination station number index, clear cargo destination station number for index, move machine date to cargo release date, move machine time to cargo release time, move ACF2 user ID to cargo release by, move 'RELEASED' to cargo current status, move 'R' to cargo release status, move 'A' to cargo release type, clear cargo release reason, clear cargo error or release status index, and clear cargo error status
Context: Canadian cargo has been released or authorized to deliver
GIVEN
Canadian cargo has been released or authorized to deliver
Applied to: 31:Process Associated US Manifest
WHEN
US manifest processing is performed
THEN
Set US manifest not found flag, set not end of file flag, perform get unique US cargo by car and waybill, perform get next US cargo by car and waybill until US manifest found or end of file, if end of file then exit, else move log information, concatenate machine century with machine date into log date, move machine time to log time, move log use input message to action code, move US cargo CCN key to train or US CCN field, set cargo type to US cargo, concatenate 'CDN CCN RLSED BY EDI 350: ' with cargo CCN key into message, and perform spawn log entry
Context: V9 notice reason indicates authorized to deliver
GIVEN
V9 notice reason indicates authorized to deliver
Applied to: 32:Process CSA Authorization
WHEN
CSA authorization processing is performed
THEN
If cargo CSA indicator is on then move 'EDI 350: ACCEPTED - CSA' to info message, perform log cargo info message, set cargo status to CSA delivery, set cargo CSA authorization to deliver received flag to true, and perform cargo replace, else move 'EDI 350: NOT ACCEPTED - NON-CSA' to info message and perform log cargo info message
Context: Master manifest has been released or deconsolidated
GIVEN
Master manifest has been released or deconsolidated
Applied to: 33:Process Follower Manifests
WHEN
Multi follower processing is performed
THEN
Set accept status to 'GEGB', clear follower manifest array, set index to 1, perform until follower end of database or index exceeds 100: call database with get next function for cargo using B0 qualifier, if status code is spaces and saved CCN equals master manifest CCN then if cargo is master manifest then continue else move cargo CCN key to follower manifest array at index and add 1 to index, else set follower end of database flag, subtract 1 from index, if index is less than or equal to zero then exit, else perform varying index from 1 by 1 until follower manifest at index is spaces or low values or index exceeds limit: move follower manifest CCN to cargo key value, perform cargo lookup, if cargo found then perform set release information, clear info message, if V9 released then concatenate 'EDI 350: RELEASE : ' with X4 CBSA release reference ID positions 1 through 15, ' AT PORT ' with P4 port code positions 1 through 4 into info message and concatenate X4 CBSA release reference ID positions 1 through 15, '/' with P4 port code positions 1 through 4 into cargo release reason, else concatenate 'EDI 350: RELEASE VIA DECON AT PORT ' with P4 port code positions 1 through 4 into info message and concatenate 'DECONSOLIDATION AT ' with P4 port code positions 1 through 4 into cargo release reason, move cargo CCN key to current CCN key, perform log cargo info message, move cargo waybill key to save waybill index, move cargo equipment car to current car ID key, perform process US manifest, clear status code, set accept status to spaces, and call database with replace function for cargo
Context: Cargo has been placed on hold and CCN starts with 6105
GIVEN
Cargo has been placed on hold and CCN starts with 6105
Applied to: 34:Prepare Cargo Hold Email
WHEN
Merlin hold preparation is performed
THEN
Clear detail line 1, concatenate 'Cargo on HOLD for inspection by CBSA - EDI350' into detail line 1, clear detail line 2, concatenate 'Equipment : ' with cargo equipment ID for index into detail line 3, concatenate 'Waybill : ' with cargo CCN carrier index, cargo origin station number index, cargo waybill number index into detail line 4, concatenate 'CCN : ' with cargo CCN key into detail line 5, concatenate 'DESTINATION : ' with cargo destination station name, ', ' with cargo destination station state code into detail line 6, concatenate 'MANIFEST UPON : ' with cargo manifest to station name into detail line 7, set line count to 7, set message type to hold, and perform email send preparation
Context: Email notification has been prepared with message type and content
GIVEN
Email notification has been prepared with message type and content
Applied to: 39:Send Email Notification
WHEN
Email send preparation is performed
THEN
If message type is error then concatenate 'CUSTOMS RECEIVED ERR MSG ' with cargo CCN key into subject, else if message type is info then concatenate 'BROKER/MANIFEST MISMATCH ' with cargo CCN key into subject, else if message type is hold then concatenate 'CBSA CARGO HOLD - ' with cargo CCN key into subject, else move detail line 1 to subject, save current recipient and filename, clear recipient, if admin segment found then move admin DC Merlin 1 to recipient 1 and admin DC Merlin 5 to recipient 2, else move 'OM01247' to recipient 1 and clear recipient 2, if keywords are spaces or low values then if cargo found and cargo CCN key not spaces then move cargo CCN key to keywords, else move current CCN key to keywords, if message type is unknown then move 'UNKNOWN' to filename, clear recipient, move 'OM01247' to recipient 1, and perform call email send, else if message type is error then move 'CAERROR' to filename, perform call email send, move 'IN' to filename, clear recipient, move 'OM01247' to recipient 1, and perform call email send, else if message type is info then move 'IN' to filename, clear recipient, move 'OM01247' to recipient 1, and perform call email send, else if message type is unrelease then move 'IN' to filename, perform call email send, clear recipient, perform fetch manifest station segment, if manifest station Merlin ID not spaces then move 'IN' to filename, move manifest station Merlin ID to recipient 1, and perform call email send, else if message type is release then clear recipient, perform fetch manifest station segment, if manifest station Merlin ID not spaces then move 'IN' to filename, move manifest station Merlin ID to recipient 1, and perform call email send, else if message type is hold then move 'CAHOLD' to filename, clear recipient, move 'OM01247' to recipient 1, and perform call email send, then perform reset report fields