1 /* ***********************************************************
 2    *                                                         *
 3    * Copyright, (C) Honeywell Information Systems Inc., 1982 *
 4    *                                                         *
 5    * Copyright (c) 1972 by Massachusetts Institute of        *
 6    * Technology and Honeywell Information Systems, Inc.      *
 7    *                                                         *
 8    *********************************************************** */
 9 
10 
11 stop_at:  proc(string);
12 
13 dcl       string char(*) unaligned,
14           (index, substr) builtin,
15           ln fixed bin(14),
16           fn fixed bin(8),
17           sn fixed bin(5),
18           (k,n) fixed bin,
19           cv_dec_ entry(char(*) aligned) returns(fixed bin),
20           (pl1_stat_$stop_id, cg_static_$stop_id) bit(27) external static;
21 
22           n = index(string,".");
23           fn = 0;
24 
25           if n = 0
26           then do;
27                ln = cv_dec_((string));
28                sn = 1;
29                end;
30           else do;
31                     k = index(substr(string,n+1),".");
32                     if k = 0
33                     then do;
34                          ln = cv_dec_(substr(string,1,n-1));
35                          sn = cv_dec_(substr(string,n+1));
36                          end;
37                     else do;
38                          fn = cv_dec_(substr(string,1,n-1));
39                          ln = cv_dec_(substr(string,n+1,k-1));
40                          sn = cv_dec_(substr(string,n+k+1));
41                          end;
42                end;
43 
44           cg_static_$stop_id,
45           pl1_stat_$stop_id = bit(fn,8) || bit(ln,14) || bit(sn,5);
46 
47           end;