# IBM Global Services VAN API SCRIPT for async communications (ibmgs.asc) # # Updated and tested: Nov. 99 w/ TLE v4.2 #---------------------------------------------------------------------------- # # Important Notes: # 1. This script uses IBM GS' ASYNC command set for only EDI data. Please # make sure the Mailbox Modem Properties are set to XMODEM and 8,N,1. # # 2. The IBMGS "ACCOUNT" Account_ID in the LOGIN section can be setup by: # a) creating a Mailbox using the Account_ID name, or # b) changing "{mb}" in the 2 "send" commands in the LOGIN section to the # actual Account_ID value. # # 3. This script assumes that your IE password is the same as your IE # userid. You may change the "+CONNECT" line below to use a different # password or use {pw} which is your network password. # # 4. IBM inserts control characters for modem flow control. These chars # interfere with the Translator, so to strip them out, modify the # $EDIH/etc/config.asc file and add the line "DEFRECEIVEMODE=TEXT" to the # "[File Transfer]" section and make sure the Cleo character translation # file of "xlatin.ovr" has the lines 4 (^D), 13 (^M), & 26 (^Z) set to "*". # For example: 4 * # 13 * # 26 * #---------------------------------------------------------------------------- # # This script contains four sections: Login (for logging onto the network # and Information Exchange), Exchange (send and receive), # receive (receive only) and transmit (send only). # The login section logs onto the network and selects Expedite/Async as # the service to be used. Then it logs onto Information Exchange. # # In order to limit the data that is received to EDI only, you can specify # EDIRCV(Y) or USERCLASS() parameter with the appropriate default EDI classes. # For example, to receive EDI data only modify # 'send "+SELECT;\X0D" NNL' to 'send "+SELECT EDIRCV(Y);\X0D" NNL' # To receive X12 data only modify # 'send "+SELECT;\X0D" NNL' to # 'send "+SELECT EDIRCV(Y) USERCLASS(#E2);\X0D" NNL' # # The default classes for EDI types are: # # EDI Type Class # --------- ----- # X12 #E2 # UCS #EC # EDIFACT #EE # UN/TDI #EU # # See "Using Expedite/Async" manual from IBM Global Services for a description # of other features of Expedite/Async that you can use in this script. # # If case of communications problems, add "-tc15" parameter to "cgwd" # command in "start.edi", turn traces on in "Mailbox Properties" and # view "edilog" file in "edilog" directory to determine the cause of the # error. # #---------------------------------------------------------------------------- # # Setup Default and Protocol Section protocol XMODEM=XMODEM default loginLoop=2 #---------------------------------------------------------------------------- # # # Solicited LOGIN into IBM Global Network, then Information Exchange # :LOGIN wait 5 send "+LOGON EXPASYNC ACCOUNT({mb}) USERID({uid}) PASSWORD({pw});\X0D" NNL branch fail 98 wait 5 20 recv "READY" branch fail 98 branch false 20 send "+CONNECT ACCOUNT({mb}) USERID({uid}) PASSWORD({uid});\X0D" NNL branch fail 99 wait 5 30 recv "READY" branch fail 99 branch false 30 exit 98 failrc "NET_LOG: Network login failed. Verify network account({mb}), userid({uid}) and password({pw})." exit 99 failrc "IE_LOG: IE login failed. Verify IE account({mb}), userid({uid}) and password({uid})." exit :ELOGIN # # # Solicited EXCH # :EXCH # receive data first 10 send "+SELECT;\X0D" NNL branch fail 99 20 recv "SELECT DOCUMENTS FOLLOW" branch "NO DOCUMENTS" 50 branch fail 99 branch "REJECT" 10 branch false 20 recv mb branch fail 99 30 recv "EOF" branch fail 99 branch false 30 xlate # send data second 50 recv " " 60 send "+SEND;\X0D" NNL 70 recv "READY" branch fail 99 branch "REJECT" 60 branch false 70 send mb append branch fail 99 send "+EOF;\X0D" NNL branch fail 99 80 recv "READY" branch fail 99 branch false 80 updmb compl send "+LOGOFF;\X0D" NNL exit 99 updmb sched send "+LOGOFF;\X0D" NNL failrc "FAIL_ASC: Did not receive expected response from IE." :EEXCH #---------------------------------------------------------------------------- # # # Solicited RECV # :RECV 10 send "+SELECT;\X0D" NNL branch fail 99 20 recv "SELECT DOCUMENTS FOLLOW" branch "NO DOCUMENTS" 90 branch fail 99 branch "REJECT" 10 branch false 20 recv mb branch fail 99 30 recv "EOF" branch fail 99 branch false 30 xlate 90 updmb compl send "+LOGOFF;\X0D" NNL exit 99 updmb sched send "+LOGOFF;\X0D" NNL failrc "FAIL_ASC: Did not receive expected response from IE." :ERECV #---------------------------------------------------------------------------- # # # Solicited XMIT # :XMIT 60 send "+SEND;\X0D" NNL 70 recv "READY" branch fail 99 branch "REJECT" 60 branch false 70 send mb append branch fail 99 send "+EOF;\X0D" NNL branch fail 99 80 recv "READY" branch fail 99 branch false 80 updmb compl send "+LOGOFF;\X0D" NNL exit 99 updmb sched send "+LOGOFF;\X0D" NNL failrc "FAIL_ASC: Did not receive expected response from IE." :EXMIT #---------------------------------------------------------------------------- # # # Unsolicited exchange data (not used) :UNSEXCH EXIT :EUNSEXCH #---------------------------------------------------------------------------- # End of Script