EDI - Setting up EDI File Transfer and Edi Receive Data to execute automatically on UNIX. In order to have the EDI File Transfer and the EDI Receive Data to execute automatically on UNIX, the following setups must be done: 1) Create a DEMON user in the MXP system, if one is not yet setup. 2) Prepare permanent stack jobs for each application logon. This can be done by using the stackable logon option for each application. ie. op 7 2 is the stackable logon option for the OP application. For the Parameters enter the information marked with <= , also note that ?? is the application being refered to. (ie ap, op, edi, ... etc) Parameter Output: to ??.logon.out page-size 60 <= Report Output: to ??.logon.out page-size 60 <= Log ON/OFF: on <= Entity (|RETURN| = Default): <= Date (01/01/51 = Today): 01/01/51 <= Year (0 = Current): 0 <= Period (0 = Current): 0 <= Do you wish to: proceed, stack, background or cancel [p/s/b/c] s <= Is this a permanent job? yes <= Enter job name of your choice or return to keep this one edi-logon-?? <= 3) Prepare a permanent stack containing the stacks from step 2, using MXP option ht 2 52. For the Parameters enter the information marked with <= : Parameter Output: to edi.log.out page-size 60 <= Report Output: to edi.log.out page-size 60 <= Starting Job Name: edi-logon-aa <= Ending Job Name: edi-logon-zz <= Override individual dates?: yes <= Override individual outputs?: no <= Override individual memos?: no <= Override individual logins?: yes <= Do you wish to: proceed, stack, background or cancel [p/s/b/c] s <= Is this a permanent job? yes <= Enter job name of your choice or return to keep this one edi-recv-00 <= 4) Prepare permanent stack job for the EDI File transfer option (EDI 4 8). For the Parameters enter the required information marked with <, for the parameters marked as <= enter the information that is specified: Parameter Output: to file.xfr.out page-size 60 <= Report Output: to file.xfr.out page-size 60 <= From File Location: < To File Location: zzzzzzzz < Comm. Scripts to Run: 3 < Do you wish to: proceed, stack, background or cancel [p/s/b/c] s <= Is this a permanent job? yes <= Enter job name of your choice or return to keep this one edi-recv-01 <= 5) Prepare permanent stack job for the EDI Receive Data option (EDI 4 3). For the Parameters enter the required information marked with <, for the parameters marked as <= enter the information that is specified: Parameter Output: to file.recv.out page-size 60 <= Report Output: to file.recv.out page-size 60 <= Simulation: no <= Receive EDI Data From: 2 <= From File Location: < To File Location: zzzzzzzz < Do you wish to: proceed, stack, background or cancel [p/s/b/c] s <= Is this a permanent job? yes <= Enter job name of your choice or return to keep this one edi-recv-02 <= 6) Prepare a permanent stack containing the stacks from steps 3, 4 and 5, using MXP option ht 2 52. For the Parameters enter the information marked with <= : Parameter Output: to edi.log.out page-size 60 <= Report Output: to edi.log.out page-size 60 <= Starting Job Name: edi-logon-aa <= Ending Job Name: edi-logon-zz <= Override individual dates?: yes <= Override individual outputs?: no <= Override individual memos?: no <= Override individual logins?: yes <= Do you wish to: proceed, stack, background or cancel [p/s/b/c] s <= Is this a permanent job? yes <= Enter job name of your choice or return to keep this one do-stack-daily <= **** Note in the above stacks none of the Parameter Output and Report Output, can be send to /dev/null or trash. If any of the stacks are sent to these devices an ERROR Message will occur as follows: "Device already in use: /dev/null" and the EDI Transfer Files and EDI Receive Data can result in various end results, such as loading all data into the holder file. Other unknown results can occur. 7) The following UNIX shell needs to be modified: ht/pt/do-stack.sh and replace PROPATH, DLC, HOME, AND PROTERMCAP. # pt/do-stack.sh Script to fire up stacker # REPLACE PROPATH, DLC, HOME, and PROTERMCAP values by corresponding # values for your system ########################################################################### # VARNET DEVELOPMENT CORPORATION owns all rights to this unpublished work # # which is protected as a trade secret. VARNET DEVELOPMENT CORPORATION may# # also seek to protect this as an unpublished copyright work. # # In the event of either inadvertent or deliberate publication, # # VARNET DEVELOPMENT CORPORATION intends to enforce its rights under the # # copyright laws as a published work # # (C) Copyright, VARNET DEVELOPMENT CORPORATION, 1984 through 1991. # ########################################################################### umask 0000 TERM=vt100 PATH=.:$PATH DLC=/tools/dlc6.3e if test -f $DLC/bin/_progres then DLCEXE=$DLC/bin PROPARMS=client7.pf else DLCEXE=$DLC PROPARMS=client6.pf fi PROTERMCAP=$DLC/protermcap PROPATH=.:/mid/RD/htdev:/mid/RD/HT72a-02 HOME=/tools/home/rd/serge TTY=daemon USERID=demon STARTDATE=`date +%D` export TERM PATH export DLC DLCEXE PROTERMCAP PROPATH PROPARMS HOME TTY USERID STARTDATE trap "" 1 # note: pt/demon0 will use connection file found in TTY.tmp echo daemon.con > $TTY.tmp echo pt/do-stack > $TTY.pgm # note: client.pf should have the right parameter to start progress if test "$PROEXE" = "" then eval $DLCEXE/_progres -pf $PROPARMS -b -p pt/demon0 >stack.log 2>&1 & else eval $PROEXE -pf $PROPARMS -b -p pt/demon0 >stack.log 2>&1 & fi wait if test -f $HOME/$TTY.dis then eval $HOME/$TTY.dis >> $HOME/$TTY.log ; rm $HOME/$TTY.dis fi rm $TTY.tmp $TTY.pgm # # This is the file use by the process: # ------------------------------------ # # daemon.con Connection file for demon # daemon.dis Instruction file for shutdown # stack.log Stacker log # demon.log Demon log for background process # demon.active Demon status # daemon.log Demon log for stacker process # daemon.pgm File to determine wich program to run # demon.audit Audit file for demon # demon.in Demon file for job parameter # demon.out Demon output for job # demon.rpt Demon report parameter # 9) Create the following program in mxp : edi/ediauto.sh This program executes the do-stack.sh shell, prints the Receive EDI Report, and does file manipulation so that a backup of the jobs executed is kept. ## edi/ediauto.sh ## Execute do-stack.sh and create backup files of reports generated ## Stella Nico - August 1998 ## ******************************************************************** */ ## This is an unpublished work created in 1984 through 1998 */ ## G.T.R. DATA INC. owns all rights to this work and intends to keep */ ## the work confidential so as to maintain its value as a trade secret. */ ## G.T.R. DATA INC. may also seek to protect this work as an unpublished*/ ## copyright work. In the event of either inadvertent or deliberate */ ## publication, G.T.R. DATA INC. ntends to enforce its rights for this*/ ## work under the copyright laws as a published work; and to that end, */ ## G.T.R. DATA INC. hereby affixes the following statutory notice: */ ## (C) Copyright, G.T.R. DATA INC. 1984 through 1998. */ ## ******************************************************************** */ set `date` DATESTAMP=`date +%Y%m%d` cd /data1/mapics/mxptest /data1/mapics/ht/pt/do-stack.sh cd /data1/mapics/mxptest lpr file.recv.out cat ap.logon.out >> /xxx/ediautobkp/auto-logins.log.$DATESTAMP cat edi.logon.out>> /xxx/ediautobkp/auto-logins.log.$DATESTAMP cat in.logon.out >> /xxx/ediautobkp/auto-logins.log.$DATESTAMP cat op.logon.out >> /xxx/ediautobkp/auto-logins.log.$DATESTAMP cat po.logon.out >> /xxx/ediautobkp/auto-logins.log.$DATESTAMP cat edi.log.out >> /xxx/ediautobkp/auto-logins.log.$DATESTAMP cat file.xfr.out >> /xxx/ediautobkp/file.xfr.log.$DATESTAMP cat file.recv.out>> /xxx/ediautobkp/file.recv.$DATESTAMP cat stack.log >> /xxx/ediautobkp/stack.log.$DATESTAMP rm ap.logon.out rm edi.logon.out rm in.logon.out rm op.logon.out rm po.logon.out rm edi.log.out rm file.xfr.out rm file.recv.out rm stack.log 10) In UNIX modify the "crontab" in order to execute the edi/ediauto.sh on the desired days and times. For further information on "crontab" type at the UNIX prompts the command man crontab . An example of a crontab executing the edi/ediauto.sh is as follows: 30 8 * * 1-5 /xxx/edi/ediauto.sh 30 13 * * 1-5 /xxx/edi/ediauto.sh 00 23 1 2 * /xxx/edi/ediauto.sh 45 5 * * 0 /xxx/edi/ediauto.sh The crontabs files consist of lines of six fields each. The fields are separated by spaces or tabs. The first five are integer patterns that specify the minute (0-59), hour (0-23), day of the month (1-31), month of the year (1-12), and day of the week (0-6, with 0=Sunday). Thus the first line says at 30 minutes, 8 o'clock, everyday of the month, for every month of the year, on Mondays thru Friday execute the job /xxx/edi/ediauto.sh. The second line says at 30 minutes, 13 o'clock, everyday of the month, for every month of the year, on Mondays thru Friday execute the job /xxx/edi/ediauto.sh. The third line says at 00 minute, 23 o'clock, the first day of the month, for the month of february, execute the job /xxx/edi/ediauto.sh. The last line says at 45 minutes, 5 o'clock, everyday of the month, for every month of the year, on Sundays execute the job /xxx/edi/ediauto.sh. ** In order to test the whole procedure there is the UNIX command ==> at, which can be used to execute the shell script as if it was in the crontab. The command is as follows: at /xxx/edi/ediauto.sh now For further information on the "at" command type at the UNIX prompts the command man at