1 /* BEGIN INCLUDE FILE  gtss_filact_intp7.incl.pl1 */
 2 bcd_message: proc (ml, mw, bp, m);
 3 
 4 /**       Convert message (m) to bcd.
 5           Store in user's buffer (location bmp).
 6           Set ml to this location and mw to number of words
 7           in message.
 8 
 9           Zero ml and mw if not possible.
10 **/
11 dcl  ml                       bit(18)unal parm;
12 dcl  mw                       fixed bin(17)unal parm;
13 dcl  bp                       ptr parm;
14 dcl  m                        char(*)parm;
15           ml = "0"b;
16           mw = 0;
17 
18           l = length (m);
19           n = divide (l+5, 6, 17, 0);                       /* Number of words. */
20           if n>355 then do;
21                n = 355;
22                l = n*6;
23           end;
24 
25           bmp = addrel (bp, 25);                            /* => 355 FMS buffer portion of 380 word buffer. */
26           call gtss_ascii_bcd_ (addr (m), l, bmp);
27           f = mod (l, 6);                                   /* Characters to fill to word. */
28 
29           if f>0 then msg.last_word.blank = "20"b3;
30           ml = rel (bmp);                                   /* Word offset to message (in caller's buffer). */
31           mw = n;
32           return;
33 dcl  n                        fixed bin;
34 dcl  f                        fixed bin;
35 dcl  l                        fixed bin;
36 
37 dcl  bmp                      ptr;
38 dcl 1 msg aligned based(bmp),
39     2 fill (n-1),
40     2 last_word,
41       3 skip  (f)bit(6)unal,
42       3 blank (6-f)bit(6)unal;
43      end                                                    /* bcd_message */;
44 /*   END INCLUDE FILE  gtss_filact_intp7.incl.pl1 */