1 02/06/84  datebin_
  2 
  3 The datebin_ subroutine has several entry points to convert clock
  4 readings into binary integers (and vice versa) representing the year,
  5 month, day, hour, minute, second, current shift, day of the week,
  6 number of days since January 1, 1901, and the number of days since
  7 January 1 of the year indicated by the clock.  Clock readings are
  8 Multics Greenwich mean time (GMT); all other arguments represent local
  9 time.
 10 
 11 If arguments passed to datebin_ are not in the valid range, the
 12 returned arguments are generally 0 (in certain cases, no checking
 13 should be done).
 14 
 15 
 16 Entry points in datebin_:
 17    (List is generated by the help command)
 18 
 19 
 20 :Entry:  clockathr:  02/06/84 datebin_$clockathr
 21 
 22 
 23 Function: returns a clock reading for the next time the given hour
 24 occurs.
 25 
 26 
 27 Syntax:
 28 declare datebin_$clockathr entry (fixed bin, fixed bin(71));
 29 call datebin_$clockathr (zz, clock);
 30 
 31 
 32 Arguments:
 33 zz
 34    is the desired hour and minutes expressed as hhmm in decimal (e.g.,
 35    1351).  (Input)
 36 clock
 37    is a calendar clock reading with the number of microseconds since
 38    0000 GMT January 1, 1901.  (Output)
 39 
 40 
 41 :Entry:  datebin:  02/06/84 datebin_
 42 
 43 
 44 Function: returns the month, day, year, hour, minute, second, weekday,
 45 shift, and number of days since January 1, 1901, given a calendar
 46 clock reading.
 47 
 48 
 49 Syntax:
 50 declare datebin_ entry (fixed bin(71), fixed bin, fixed bin, fixed bin,
 51      fixed bin, fixed bin, fixed bin, fixed bin, fixed bin, fixed bin);
 52 call datebin_ (clock, absda, mo, da, yr, hr, min, sec, wkday, s);
 53 
 54 
 55 Arguments:
 56 clock
 57    is a calendar clock reading with the number of microseconds since
 58    0000 GMT January 1, 1901.  (Input)
 59 absda
 60    is the number of the days the clock reading represents (with January
 61    1, 1901 = 1).  (Output)
 62 mo
 63    is the month (1-12).  (Output)
 64 da
 65    is the day of the month (1-31).  (Output)
 66 yr
 67    is the year (1901-1999).  (Output)
 68 hr
 69    is the hour of the day (0-23).  (Output)
 70 
 71 
 72 min
 73    is the minute of the hour (0-59).  (Output)
 74 sec
 75    is the second of the minute (0-59).  (Output)
 76 wkday
 77    is the day of the week (1 = Monday, 7 = Sunday).  (Output)
 78 s
 79    is the shift, as defined in installation_parms.  (Output)
 80 
 81 
 82 :Entry:  datofirst:  02/06/84 datebin_$datofirst
 83 
 84 
 85 Function: returns the number of days since January 1, 1901, up to but
 86 not including January 1 of the year specified.
 87 
 88 
 89 Syntax:
 90 declare datebin_$datofirst entry (fixed bin, fixed bin);
 91 call datebin_$datofirst (yr, datofirst);
 92 
 93 
 94 Arguments:
 95 yr
 96    is the year (1901-1999).  (Input)
 97 datofirst
 98    is the number of days since January 1, 1901, up to, but not
 99    including, January 1 of the year specified.  (Output)
100 
101 
102 :Entry:  dayr_clk:  02/06/84 datebin_$dayr_clk
103 
104 
105 Function: returns the day of the year (1-366) given a calendar clock
106 reading.  If clock is invalid, -1 is returned.
107 
108 
109 Syntax:
110 declare datebin_$dayr_clk entry (fixed bin(71), fixed bin);
111 call datebin_$dayr_clk (clock, dayr);
112 
113 
114 Arguments:
115 clock
116    is a calendar clock reading with the number of microseconds since
117    0000 GMT January 1, 1901.  (Input)
118 dayr
119    is the day of the year (1-366).  (Output)
120 
121 
122 :Entry:  dayr_mo:  02/06/84 datebin_$dayr_mo
123 
124 
125 Function: returns the day of the year when given a month, day, and
126 year.
127 
128 
129 Syntax:
130 declare datebin_$dayr_mo entry (fixed bin, fixed bin, fixed bin,
131      fixed bin);
132 call datebin_$dayr_mo (mo, da, yr, dayr);
133 
134 
135 Arguments:
136 mo
137    is the month (1-12).  (Input)
138 da
139    is the day of the month (1-31).  (Input)
140 yr
141    is the year (1901-1999).  (Input)
142 dayr
143    is the day of the year (1-366).  (Output)
144 
145 
146 :Entry:  following_midnight:  02/06/84 datebin_$following_midnight
147 
148 
149 Function: given a clock reading, returns a clock reading for midnight
150 (local time) of that day.
151 
152 
153 Syntax:
154 declare datebin_$following_midnight entry (fixed bin(71),
155      fixed bin(71));
156 call datebin_$following_midnight (oldclock, clock);
157 
158 
159 Arguments:
160 oldclock
161    is a calendar clock reading in microseconds since January 1, 1901,
162    0000 GMT.  (Input)
163 clock
164    is a calendar clock reading with the number of microseconds since
165    0000 GMT January 1, 1901.  (Output)
166 
167 
168 :Entry:  last_midnight:  02/06/84 datebin_$last_midnight
169 
170 
171 Function: returns a clock reading for the midnight (local time)
172 preceding the current day.
173 
174 
175 Syntax:
176 declare datebin_$last_midnight entry (fixed bin(71));
177 call datebin_$last_midnight (clock);
178 
179 
180 Arguments:
181 clock
182    is a calendar clock reading with the number of microseconds since
183    0000 GMT January 1, 1901.  (Output)
184 
185 
186 :Entry:  next_shift_change:  02/06/84 datebin_$next_shift_change
187 
188 
189 Function: given a clock reading, returns the time of the next shift
190 change, the current shift, and the new shift.
191 
192 
193 Syntax:
194 declare datebin_$next_shift_change entry (fixed bin(71), fixed bin(71),
195      fixed bin, fixed bin);
196 call datebin_$next_shift_change (clock, newclock, shift, newshift);
197 
198 
199 Arguments:
200 clock
201    is a calendar clock reading with the number of microseconds since
202    0000 GMT January 1, 1901.  (Input)
203 newclock
204    is the time the shift changes next after clock.  (Output)
205 shift
206    is the current shift at time clock.  (Output)
207 newshift
208    is the shift that begins at time newclock.  (Output)
209 
210 
211 :Entry:  preceding_midnight:  02/06/84 datebin_$preceding_midnight
212 
213 
214 Function: given a clock reading, returns a clock reading for midnight
215 (local time) of the preceding day.
216 
217 
218 Syntax:
219 declare datebin_$preceding_midnight entry (fixed bin(71),
220      fixed bin(71));
221 call datebin_$preceding_midnight (oldclock, clock);
222 
223 
224 Arguments:
225 oldclock
226    is a calendar clock reading in microseconds since January 1, 1901,
227    0000 GMT.  (Input)
228 clock
229    is a calendar clock reading with the number of microseconds since
230    0000 GMT January 1, 1901.  (Output)
231 
232 
233 :Entry:  revert:  02/06/84 datebin_$revert
234 
235 
236 Function returns a calendar clock reading for the month, day, year,
237 hour, minute, and second specified.
238 
239 
240 Syntax:
241 declare datebin_$revert entry (fixed bin, fixed bin, fixed bin,
242      fixed bin, fixed bin, fixed bin, fixed bin(71));
243 call datebin_$revert (mo, da, yr, hr, min, sec, clock);
244 
245 
246 Arguments:
247 mo
248    is the month (1-12).  (Input)
249 da
250    is the day of the month (1-31).  (Input)
251 yr
252    is the year (1901-1999).  (Input)
253 hr
254    is the hour of the day (0-23).  (Input)
255 
256 
257 min
258    is the minute of the hour (0-59).  (Input)
259 sec
260    is the second of the minute (0-59).  (Input)
261 clock
262    is a calendar clock reading with the number of microseconds since
263    0000 GMT January 1, 1901.  (Output)
264 
265 
266 :Entry:  revertabs:  02/06/84 datebin_$revertabs
267 
268 
269 Function: returns a calendar clock reading given the number of days
270 since January 1, 1901.
271 
272 
273 Syntax:
274 declare datebin_$revertabs entry (fixed bin, fixed bin(71));
275 call datebin_$revertabs (absda, clock);
276 
277 
278 Arguments:
279 absda
280    is the number of the days the clock reading represents (with
281    January 1, 1901 = 1).  (Input)
282 clock
283    is a calendar clock reading with the number of microseconds since
284    0000 GMT January 1, 1901.  (Output)
285 
286 
287 :Entry:  shift:  02/06/84 datebin_$shift
288 
289 
290 Function: returns the shift given a calendar clock reading.  If clock
291 is invalid, -1 is returned.
292 
293 
294 Syntax:
295 declare datebin_$shift (fixed bin(71), fixed bin);
296 call datebin_$shift (clock, s);
297 
298 
299 Arguments:
300 clock
301    is a calendar clock reading with the number of microseconds since
302    0000 GMT January 1, 1901.  (Input)
303 s
304    is the shift, as defined in installation_parms.  (Output)
305 
306 
307 :Entry:  this_midnight:  02/06/84 datebin_$this_midnight
308 
309 
310 Function: returns a clock reading for midnight (local time) of the
311 current day.
312 
313 
314 Syntax:
315 declare datebin_$this_midnight entry (fixed bin(71));
316 call datebin_$this_midnight (clock);
317 
318 
319 Arguments:
320 clock
321    is a calendar clock reading with the number of microseconds since
322    0000 GMT January 1, 1901.  (Output)
323 
324 
325 :Entry:  time:  02/06/84 datebin_$time
326 
327 
328 Function: returns the hour, minute and second given a calendar clock
329 reading.  If clock is invalid, hr, min, and sec are -1.
330 
331 
332 Syntax:
333 declare datebin_$time entry (fixed bin(71), fixed bin, fixed bin,
334      fixed bin);
335 call datebin_$time (clock, hr, min, sec);
336 
337 
338 Arguments:
339 clock
340    is a calendar clock reading with the number of microseconds since
341    0000 GMT January 1, 1901.  (Input)
342 hr
343    is the hour of the day (0-23).  (Output)
344 min
345    is the minute of the hour (0-59).  (Output)
346 sec
347    is the second of the minute (0-59).  (Output)
348 
349 
350 :Entry:  wkday:  02/06/84 datebin_$wkday
351 
352 
353 Function: returns the day of the week (Monday = 1 ...  Sunday = 7)
354 given a calendar clock reading.  If clock is invalid, 0 is returned.
355 
356 
357 Syntax:
358 declare datebin_$wkday entry (fixed bin(71), fixed bin);
359 call datebin_$wkday (clock, wkday);
360 
361 
362 Arguments:
363 clock
364    is a calendar clock reading with the number of microseconds since
365    0000 GMT January 1, 1901.  (Input)
366 wkday
367    is the day of the week (1 = Monday, 7 = Sunday).  (Output)