0010**________________________________________________________________ _
0020**
0030** ADASF003
0040** Subrutina que permite enviar un emilio
0050** a una persona de la casa con 10 ficheros adjuntos
0060** mas uno con texto explicativo
0070** Todos los nombres tienen que ser minusculas
0080**
0090** 22-II-2002 ccc/IC
0100**
0110**_________________________________________________________________
0120define data
0130parameter using ADAPF003
0140local
01501 wcomand (a253)
01601 estruc
0170 2 numero (i4)
0180 2 nombre (a52)
01901 wtiempo (a8)
02001 wregistro-f (a250)
02101 wregistro (a250)
02201 redefine wregistro
0230 2 wregistro-1 (a70)
0240 2 wregistro-2 (a70)
0250 2 wregistro-3 (a70)
0260 2 wregistro-4 (a40)
02701 wconta (n3)
02801 wi (n3)
02901 wfichero-sal (a52)
03001 wfile-exec (a52)
03101 wcommand (a80)
03201 wretcode (i4)
03301 wregistro-80 (a80)
03401 wind (n3)
03501 wdestinatario (a40)
03601 wnumi (n3)
0370*
0380end-define
0390*
0400** ******************__________________________________
0410define subroutine SE-MANDA-UN-ISMAEL
0420** ******************__________________________________
0430*
0440move 1 to numero
0450move '/home1/sag/nomina/bancos/scripts/ maqueta.pla' to nombre
0460*
0470call 'cmswrkfn' estruc
0480*
0490move 2 to numero
0500move '/home1/sag/nomina/tmp/maqueta' to nombre
0510move edited *timx(em=DDHHIISS) to wtiempo
0520compress nombre wtiempo '.txt' into nombre leaving no
0530move nombre to wfichero-sal
0540*
0550call 'cmswrkfn' estruc
0560*
0570if pfiletext ne ' '
0580 move 3 to numero
0590 move pfiletext to nombre
0600*
0610 call 'cmswrkfn' estruc
0620*
0630end-if
0640*
0650r1. read work file 1 wregistro
0660*
0670 add 1 to wconta
0680 if wconta le 7
0690 escape top
0700 end-if
0710 examine wregistro for 'wwremite' giving number wind
0720 if premite ne ' '
0730 and wind ne 0
0740 examine wregistro for 'wwremite' replace premite
0750 move wregistro to wregistro-f
0760 *
0770 write work file 2 wregistro-f
0780 *
0790 end-if
0800 *
0810 examine wregistro for 'wwdestina' giving number wind
0820 if pdestinatario ne ' '
0830 and wind ne 0
0840 move pdestinatario to wdestinatario
0850 compress wdestinatario '@aragob.es' into wdestinatario leaving no
0860 examine wregistro for 'wwdestina' replace wdestinatario
0870 move wregistro to wregistro-f
0880 *
0890 write work file 2 wregistro-f
0900 *
0910 end-if
0920 *
0930 examine wregistro for 'wwcopia' giving number wind
0940 if pcopia ne ' '
0950 and wind ne 0
0960 examine wregistro for 'wwcopia' replace pcopia
0970 move wregistro to wregistro-f
0980 *
0990 write work file 2 wregistro-f
1000 *
1010 end-if
1020 *
1030 examine wregistro for 'wwcopib' giving number wind
1040 if pbcopia ne ' '
1050 and wind ne 0
1060 examine wregistro for 'wwcopib' replace pbcopia
1070 move wregistro to wregistro-f
1080 *
1090 write work file 2 wregistro-f
1100 *
1110 end-if
1120 *
1130 examine wregistro for 'wwsubject' giving number wind
1140 if psubject ne ' '
1150 and wind ne 0
1160 examine wregistro for 'wwsubject' replace psubject
1170 move wregistro to wregistro-f
1180 *
1190 write work file 2 wregistro-f
1200 *
1210 end-if
1220 *
1230 examine wregistro for 'wwreply' giving number wind
1240 if preply ne ' '
1250 and wind ne 0
1260 examine wregistro for 'wwreply' replace preply
1270 move wregistro to wregistro-f
1280 *
1290 write work file 2 wregistro-f
1300 *
1310 end-if
1320 *
1330 examine wregistro for 'wwlinea' giving number wind
1340 if pfiletext ne ' '
1350 and wind ne 0
1360 *
1370 rw3. read work file 3 wregistro
1380 *
1390 move wregistro to wregistro-f
1400 *
1410 write work file 2 wregistro-f
1420 *
1430 end-work
1440 end-if
1450 *
1460 end-work
1470 close work file 1
1480 close work file 2
1490 close work file 3
1500 *
1510 move 1 to numero
1520 move '/home1/sag/nomina/bancos/scripts/ cartero.pla' to nombre
1530 *
1540 call 'cmswrkfn' estruc
1550 *
1560 move 2 to numero
1570 move '/home1/sag/nomina/tmp/cartero' to nombre
1580 compress nombre wtiempo '.bat' into nombre leaving no
1590 move nombre to wfile-exec
1600 *
1610 call 'cmswrkfn' estruc
1620 *
1630 rw. read work file 1 wregistro
1640 *
1650 examine wregistro for 'wwfile-maq' replace wfichero-sal
1660 *
1670 examine wregistro for 'wf' giving number wnumi
1680 if wnumi = 0
1690 escape top
1700 end-if
1710 for wi = 0 to 9
1720 if ta-file-adj(wi) ne ' '
1730 decide on first value wi
1740 value 0
1750 examine wregistro for 'wf0' replace ta-file-adj(wi)
1760 value 1
1770 examine wregistro for 'wf1' replace ta-file-adj(wi)
1780 value 2
1790 examine wregistro for 'wf2' replace ta-file-adj(wi)
1800 value 3
1810 examine wregistro for 'wf3' replace ta-file-adj(wi)
1820 value 4
1830 examine wregistro for 'wf4' replace ta-file-adj(wi)
1840 value 5
1850 examine wregistro for 'wf5' replace ta-file-adj(wi)
1860 value 6
1870 examine wregistro for 'wf6' replace ta-file-adj(wi)
1880 value 7
1890 examine wregistro for 'wf7' replace ta-file-adj(wi)
1900 value 8
1910 examine wregistro for 'wf8' replace ta-file-adj(wi)
1920 value 9
1930 examine wregistro for 'wf9' replace ta-file-adj(wi)
1940 none value
1950 ignore
1960 end-decide
1970 else
1980 decide on first value wi
1990 value 0
2000 examine wregistro for '-awf0' replace ' '
2010 value 1
2020 examine wregistro for '-awf1' replace ' '
2030 value 2
2040 examine wregistro for '-awf2' replace ' '
2050 value 3
2060 examine wregistro for '-awf3' replace ' '
2070 value 4
2080 examine wregistro for '-awf4' replace ' '
2090 value 5
2100 examine wregistro for '-awf5' replace ' '
2110 value 6
2120 examine wregistro for '-awf6' replace ' '
2130 value 7
2140 examine wregistro for '-awf7' replace ' '
2150 value 8
2160 examine wregistro for '-awf8' replace ' '
2170 value 9
2180 examine wregistro for '-awf9' replace ' '
2190 none value
2200 ignore
2210 end-decide
2220 end-if
2230 end-for
2240 *
2250 move wregistro to wregistro-f
2260 *
2270 write work file 2 wregistro-f
2280 *
2290 end-work
2300 close work file 1
2310 close work file 2
2320 move 'chmod 777' to wcommand
2330 compress wcommand wfile-exec into wcommand
2340 *
2350 call 'shcmd' wcommand
2360 *
2370 move wfile-exec to wcommand
2380 call 'shcmd' wcommand
2390 compute wretcode = ret('shcmd')
2400 if wretcode ne 0
2410 move 1 to perro
2420 end-if
2430 *
2440 end-subroutine
2450 *
2460 end