-
Notifications
You must be signed in to change notification settings - Fork 0
/
host.mem
10282 lines (7286 loc) · 393 KB
/
host.mem
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
************************************************************************
* *
* *
* *
* *
* *
* *
* *
* *
* *
* *
* *
* *
* *
* *
* *
* *
* *
* *
* *
* SYSTEM 1022 *
* *
* HOST LANGUAGE INTERFACE *
* *
* USER'S REFERENCE MANUAL *
* *
* FORTRAN *
* *
* COBOL *
* *
* MACRO *
* *
* *
* Revision 4, May 1986 *
* *
* *
* *
* *
* *
* *
* *
* *
* *
* *
* *
* SOFTWARE HOUSE *
* *
* Cambridge, Massachusetts *
* *
* *
* *
* *
************************************************************************
Copyright 1984 by Software House. All rights reserved.
Software House, 1105 Massachusetts Avenue
Cambridge, Massachusetts 02138, USA
ISBN 0-912055-17-0
Printed in USA.
Revision 1: October 1980
Revision 2: October 1981
Revision 3: September 1983
Revision 4: June 1984
Revision 5: May 1986
To order any System 1022 documentation,
call or write to:
Documentation Distribution
Software House
1105 Massachusetts Avenue
Cambridge, MA 02138
USA
(617)661-7023
This manual reflects version 117B of System 1022. Changes since
Revision 4, June l984, are marked with bars in the left margin.
Please send any comments or suggestions about this manual to the
Software House Documentation Department.
Documentation Available for System 1022
Introductory Literature Kit____________ __________ ___
The Kit provides a cursory introduction to the System. Included in
the Kit are:
o A brief description of the major features in System 1022
o A copy of The Data Base, the System 1022 newsletter ___ ____ ____
o Two DATA DECISIONS reports which describe System 1022
and Software House
o The Price Schedule
User's Reference Manual______ _________ ______
The User's Reference Manual contains complete information about the
interactive use of System 1022. This is the primary documentation for
the System. This manual is available in both printed and
machine-readable form. 450 pages.
Host Language User's Reference Manual____ ________ ______ _________ ______
The Host Language (HL) Manual contains information needed to write and
run FORTRAN, COBOL, and MACRO application programs using the System
1022 subroutine library. This manual is available in both printed and
machine-readable form. 150 pages.
Data Base Administrator's Manual____ ____ _______________ ______
The Data Base Administrator's (DBA's) Manual explains to the data base
administrator how to install and maintain System 1022. The Manual
describes interfacing 1022 to host languages, patching, and control
features used by the DBA. The Manual is specific to the current
version of 1022. This manual is available in both printed and
machine-readable form. 100 pages.
Primer______
The Primer introduces the interactive use of System 1022 to the new
user. The Primer is available in printed form only. 140 pages.
Report Writer Manual: Operation and Examples______ ______ _______ _________ ___ ________
The Report Writer Manual contains a collection of reports and detailed
descriptions of each to illustrate how custom reports are written.
The Manual is available in both printed and machine-readable form. 50
pages.
CHAPTER 1 USING THE SYSTEM 1022 HOST LANGUAGE INTERFACE
1.1 INTRODUCTION . . . . . . . . . . . . . . . . . . . 1-1
1.2 SUMMARY OF HOST LANGUAGE ROUTINES . . . . . . . . 1-2
1.3 I/O ERROR MESSAGES . . . . . . . . . . . . . . . . 1-5
1.4 I/O EFFICIENCY -- PMAP . . . . . . . . . . . . . . 1-6
CHAPTER 2 FORTRAN INTERFACE ROUTINES
2.1 RULES FOR USING THE FORTRAN INTERFACE . . . . . . 2-1
2.2 SUBROUTINE ARGUMENTS . . . . . . . . . . . . . . . 2-6
2.2.1 The ERRT. Option . . . . . . . . . . . . . . . . 2-7
2.3 TERMINATION OF ARGUMENT LISTS . . . . . . . . . . 2-8
2.4 VARIABLE ARGUMENT ARRAYS . . . . . . . . . . . . . 2-8
2.4.1 FIX. Option . . . . . . . . . . . . . . . . . . 2-8
2.4.2 PNT. Option . . . . . . . . . . . . . . . . . . 2-9
2.4.3 FXB. Option . . . . . . . . . . . . . . . . . 2-11
2.4.4 PTB. Option . . . . . . . . . . . . . . . . . 2-12
2.5 RUNTIME TYPE CONVERSIONS . . . . . . . . . . . . 2-14
2.6 INITIALIZATION ROUTINES . . . . . . . . . . . . 2-15
2.6.1 Initializing FORTRAN-10 Or FORTRAN-20 -- DBF6
And DBFOR . . . . . . . . . . . . . . . . . . 2-16
2.6.2 Initializing FORTRAN Version 10 With Extended
Sections -- DBFX . . . . . . . . . . . . . . . 2-16
2.6.3 Initializing FORTRAN-IV -- DBSTRT . . . . . . 2-16
2.6.4 Terminating System 1022 Processing -- DBEND . 2-17
2.7 DATA SET SELECTION ROUTINES . . . . . . . . . . 2-18
2.7.1 The OPEN Command -- DBOPEN . . . . . . . . . . 2-18
2.7.2 The CLOSE Command -- DBCLOS . . . . . . . . . 2-19
2.7.3 The DBSET Command -- DBSET . . . . . . . . . . 2-20
2.7.4 Data Set Numbers -- DBCSET And DBNSET . . . . 2-21
2.8 DATA SET INQUIRY ROUTINES . . . . . . . . . . . 2-21
2.8.1 The FIND Command -- DBFIND . . . . . . . . . . 2-21
2.8.1.1 Advanced DBFIND Features . . . . . . . . . . 2-24
2.8.2 The SAVE Command -- DBSAVE . . . . . . . . . . 2-25
2.8.3 The SEARCH Command -- DBSRCH . . . . . . . . . 2-26
2.8.4 The SELECT Command -- DBSEL . . . . . . . . . 2-26
2.8.5 The MAP Command -- DBMAP . . . . . . . . . . . 2-26
2.8.5.1 Example Of DBMAP . . . . . . . . . . . . . . 2-28
2.8.6 The Current Number Of Records -- DBNREC . . . 2-29
2.8.6.0.1 The GETREC Command -- DBGREC . . . . . . 2-29
2.8.7 The DROP Command -- DBDROP . . . . . . . . . . 2-30
2.8.8 The LET Command -- DBVAL . . . . . . . . . . . 2-30
2.8.9 Retrieving An Entire Record -- DBGET . . . . 2-31
2.8.9.0.1 The LOCK Command -- DBLOCK . . . . . . . 2-33
2.8.10 The STARTREC Command -- DBSREC . . . . . . . . 2-34
2.8.11 The SORT Command -- DBSORT . . . . . . . . . . 2-34A
2.8.12 The VALUES Command -- DBVALU . . . . . . . . . 2-34B
2.9 DATA SET UPDATE ROUTINES . . . . . . . . . . . . 2-36
2.9.1 The CHANGE Command -- DBCHNG . . . . . . . . . 2-36
2.9.2 The DELETE Command -- DBDEL . . . . . . . . . 2-38
2.9.3 The ADD Commands -- DBADD And DBADDR . . . . . 2-38
2.9.4 The UPDATE Command -- DBUPD . . . . . . . . . 2-39
2.9.5 The SET BUFFER Command -- DBBUF . . . . . . . 2-39
2.9.6 The ALLOCATE Command -- DBALLO . . . . . . . . 2-40
2.10 SPECIAL PURPOSE ROUTINES . . . . . . . . . . . . 2-40
2.10.1 The INFORM ATTRIBUTE Command -- DBINFO . . . . 2-40
2.10.2 The PERMIT Command -- DBPSWD . . . . . . . . . 2-42
2.10.3 The Number Of Attributes -- DBNATT . . . . . . 2-42
2.10.4 Resetting Internal Buffers -- DBCLR . . . . . 2-42
2.10.5 Error Handling Routines . . . . . . . . . . . 2-43
2.10.5.1 The DBERR Subroutine . . . . . . . . . . . . 2-43
2.10.5.2 The DBERRH Subroutine . . . . . . . . . . . 2-44
2.10.5.3 The DBRETN Subroutine . . . . . . . . . . . 2-46
2.10.5.4 The DBERRT Subroutine . . . . . . . . . . . 2-46
2.10.6 Converting System Dates -- DBNDAT And DBDATN . 2-47
2.10.7 Supplying Or Receiving System Variables --
DBSYSV . . . . . . . . . . . . . . . . . . . . 2-48
2.10.7.1 Value-passing With System Variables --
SYSUSER__ . . . . . . . . . . . . . . . . . 2-52
2.10.8 Executing Interactive Commands And Procedures
-- DBEXEC . . . . . . . . . . . . . . . . . . 2-52
2.10.9 Passing Records In Nonstandard Format To 1022
-- DBLODR . . . . . . . . . . . . . . . . . . 2-55
2.10.10 DBDBUG Routines . . . . . . . . . . . . . . . 2-57
2.10.11 The DBVAR Routine . . . . . . . . . . . . . . 2-58
2.11 AUDIT ROUTINES . . . . . . . . . . . . . . . . . 2-58
2.11.1 Starting The AUDIT Trail . . . . . . . . . . . 2-58
2.11.2 Writing AUDIT File Checkpoints . . . . . . . . 2-59
2.11.3 Custom AUDIT Entries . . . . . . . . . . . . . 2-59
2.11.4 Retrieving AUDIT File Information . . . . . . 2-59
2.11.5 Random Access Audit Trail Input . . . . . . . 2-64
2.11.6 Loading Programs Containing DBAxxx Calls . . . 2-65
2.11.7 Examples . . . . . . . . . . . . . . . . . . . 2-65
2.12 SAMPLE FORTRAN PROGRAMS . . . . . . . . . . . . 2-67
CHAPTER 3 COBOL INTERFACE
3.1 RULES FOR USING THE COBOL INTERFACE . . . . . . . 3-1
3.2 DATA TYPES . . . . . . . . . . . . . . . . . . . . 3-2
3.2.1 COBOL Over-Punch Characters . . . . . . . . . . 3-2
3.2.2 INTEGER Attributes . . . . . . . . . . . . . . . 3-3
3.2.3 REAL Attributes . . . . . . . . . . . . . . . . 3-4
3.2.4 TEXT Attributes . . . . . . . . . . . . . . . . 3-5
3.2.5 DATE Attributes . . . . . . . . . . . . . . . . 3-5
3.3 SUBROUTINE ARGUMENTS . . . . . . . . . . . . . . . 3-6
3.3.1 The ERRT. Option . . . . . . . . . . . . . . . . 3-7
3.4 SPECIAL RESTRICTIONS . . . . . . . . . . . . . . . 3-7
3.5 INITIALIZING COBOL -- DBCBL, DBC68, DBC74 . . . . 3-7
3.6 TERMINATING SYSTEM 1022 PROCESSING -- DBEND . . . 3-8
3.7 DATA SET SELECTION ROUTINES . . . . . . . . . . . 3-8
3.7.1 The OPEN Command -- DBOPEN . . . . . . . . . . . 3-8
3.7.2 The CLOSE Command -- DBCLOS . . . . . . . . . 3-10
3.7.3 The DBSET Command -- DBSET . . . . . . . . . . 3-10
3.7.4 Data Set Numbers -- DBCSET And DBNSET . . . . 3-11
3.8 DATA SET INQUIRY ROUTINES . . . . . . . . . . . 3-11
3.8.1 The FIND Command -- DBFIND . . . . . . . . . . 3-11
3.8.1.1 Suppression Of Trailing Spaces . . . . . . . 3-14
3.8.1.2 Advanced DBFIND Features . . . . . . . . . . 3-15
3.8.2 The SAVE Command -- DBSAVE . . . . . . . . . . 3-16
3.8.3 The SEARCH Command -- DBSRCH . . . . . . . . . 3-17
3.8.4 The SELECT Command -- DBSEL . . . . . . . . . 3-17
3.8.5 The MAP Command -- DBMAP . . . . . . . . . . . 3-18
3.8.5.1 Example Of DBMAP . . . . . . . . . . . . . . 3-20
3.8.6 The Current Number Of Records -- DBNREC . . . 3-20
3.8.6.0.1 The GETREC Command -- DBGREC . . . . . . 3-20
3.8.7 The DROP Command -- DBDROP . . . . . . . . . . 3-21
3.8.8 The LET Command -- DBVAL . . . . . . . . . . . 3-22
3.8.9 Standard Record Format . . . . . . . . . . . . 3-22
3.8.10 Retrieving An Entire Record -- DBGET . . . . 3-24A
3.8.10.0.1 The LOCK Command -- DBLOCK . . . . . . . 3-24A
3.8.11 The STARTREC Command -- DBSREC . . . . . . . . 3-24C
3.8.12 The SORT Command -- DBSORT . . . . . . . . . . 3-24C
3.8.13 The VALUES Command -- DBVALU . . . . . . . . . 3-25
3.9 DATA SET UPDATE ROUTINES . . . . . . . . . . . . 3-28
3.9.1 The CHANGE Command-- DBCHNG . . . . . . . . . 3-28
3.9.2 The DELETE Command -- DBDEL . . . . . . . . . 3-30
3.9.3 The ADD Command -- DBADD And DBADDR . . . . . 3-30
3.9.4 The UPDATE Command -- DBUPD . . . . . . . . . 3-31
3.9.5 The SET BUFFER Command -- DBBUF . . . . . . . 3-31
3.9.6 The ALLOCATE Command -- DBALLO . . . . . . . . 3-32
3.10 SPECIAL PURPOSE ROUTINES . . . . . . . . . . . . 3-32
3.10.1 The INFORM ATTRIBUTE Command -- DBINFO . . . . 3-32
3.10.1.1 Attribute Numbers . . . . . . . . . . . . . 3-34
3.10.2 The PERMIT Command -- DBPSWD . . . . . . . . . 3-34
3.10.3 The Number Of Attributes -- DBNATT . . . . . . 3-35
3.10.4 Resetting Internal Buffers -- DBCLR . . . . . 3-35
3.10.5 Error Handling Routines . . . . . . . . . . . 3-36
3.10.5.1 The DBERR Subroutine . . . . . . . . . . . . 3-36
3.10.5.2 The DBERRH Subroutine . . . . . . . . . . . 3-37
3.10.5.3 The DBRETN Subroutine . . . . . . . . . . . 3-38
3.10.5.4 The DBERRT Subroutine . . . . . . . . . . . 3-39
3.10.6 Converting System 1022 Dates -- DBNDAT And
DBDATN . . . . . . . . . . . . . . . . . . . . 3-40
3.10.7 Supplying Or Receiving System Variables --
DBSYSV . . . . . . . . . . . . . . . . . . . . 3-40
3.10.7.1 Value-passing With System Variables --
SYSUSER__ . . . . . . . . . . . . . . . . . 3-45
3.10.8 Executing Interactive Commands And Procedures
-- DBEXEC . . . . . . . . . . . . . . . . . . 3-45
3.10.9 Passing Records In Nonstandard Format To 1022
-- DBLODR . . . . . . . . . . . . . . . . . . 3-48A
3.10.10 DBDBUG Routine . . . . . . . . . . . . . . . . 3-48C
3.10.11 The DBVAR Routine . . . . . . . . . . . . . . 3-48D
3.11 AUDIT ROUTINES . . . . . . . . . . . . . . . . . 3-48D
3.11.1 Starting The AUDIT Trail . . . . . . . . . . . 3-48E
3.11.2 Entering AUDIT File Checkpoints . . . . . . . 3-48E
3.11.3 Custom AUDIT Entries . . . . . . . . . . . . . 3-48E
3.11.4 Retrieving AUDIT File Information . . . . . . 3-49
3.11.4.1 Initialization For AUDIT Retrievals . . . . 3-49
3.11.4.2 Random Access AUDIT Trail Input . . . . . . 3-54
3.11.5 Loading Programs Using DBAxxx Routines . . . . 3-55
3.11.6 Examples . . . . . . . . . . . . . . . . . . . 3-56
3.12 SAMPLE COBOL PROGRAMS . . . . . . . . . . . . . 3-58
CHAPTER 4 THE SYSTEM 1022 MACRO INTERFACE
4.1 INTRODUCTION . . . . . . . . . . . . . . . . . . . 4-1
4.2 SUBROUTINE LINKAGE . . . . . . . . . . . . . . . . 4-2
4.3 INITIALIZATION . . . . . . . . . . . . . . . . . . 4-3
4.4 MEMORY MANAGEMENT . . . . . . . . . . . . . . . . 4-3
4.4.1 Allocating Dynamic Arrays . . . . . . . . . . . 4-4
4.5 I/O MANAGEMENT . . . . . . . . . . . . . . . . . . 4-5
4.6 LOADING MACRO PROGRAMS . . . . . . . . . . . . . . 4-5
4.7 SUMMARY . . . . . . . . . . . . . . . . . . . . . 4-6
4.8 EXAMPLE MACRO PROGRAM . . . . . . . . . . . . . . 4-7
4.9 THE S1022$ MACRO DEFINITION . . . . . . . . . . 4-10
4.10 EXAMPLE PROGRAM USING S1022$ . . . . . . . . . . 4-12
4.11 USERCALL . . . . . . . . . . . . . . . . . . . . 4-13
4.11.1 Calling Conventions . . . . . . . . . . . . . 4-14
4.11.1.1 Calling Sequence . . . . . . . . . . . . . . 4-14
4.11.1.2 Parameters . . . . . . . . . . . . . . . . . 4-14
4.11.1.3 Conversions . . . . . . . . . . . . . . . . 4-15
4.11.2 Loading Conventions (TOPS-20) . . . . . . . . 4-16
4.11.3 Configuring The MACRO Library As A Host
Language Program . . . . . . . . . . . . . . . 4-17
4.11.4 Example USERCALL Routine . . . . . . . . . . . 4-17
APPENDIX A HOST LANGUAGE ERROR MESSAGES
APPENDIX B DATE REPRESENTATIONS
B.1 RADIX DATE FORM . . . . . . . . . . . . . . . . . B-1
B.2 SYSTEM 1022 ENCODED DATE . . . . . . . . . . . . . B-1
B.3 UNIVERSAL DATE-TIME FORMAT . . . . . . . . . . . . B-1
APPENDIX C OTHER HOST LANGUAGES
C.1 REQUIREMENTS . . . . . . . . . . . . . . . . . . . C-1
C.2 INITIALIZATION . . . . . . . . . . . . . . . . . . C-1
C.3 CORE MANAGEMENT . . . . . . . . . . . . . . . . . C-2
C.4 CHANNEL MANAGEMENT . . . . . . . . . . . . . . . . C-2
C.5 EXAMPLES: DBMAC, DBCORE, DBCHAN . . . . . . . . . C-3
C.6 ARGUMENTS -- XGARG. . . . . . . . . . . . . . . . C-4
C.6.1 XGARG. Call . . . . . . . . . . . . . . . . . . C-4
C.6.2 GARGL. Definition . . . . . . . . . . . . . . . C-5
C.6.3 Requirements Of XGARG. . . . . . . . . . . . . . C-6
C.6.4 Example: XGARG. . . . . . . . . . . . . . . . . C-7
CHAPTER 1
USING THE SYSTEM 1022 HOST LANGUAGE INTERFACE
1.1 INTRODUCTION
The System 1022 FORTRAN, COBOL, and MACRO interfaces are used to write
data base applications using the capabilities of System 1022 from a
host language. The Host Language Interface is a group of subroutines
which perform functions analogous to the commands of the interactive
System. We assume that the reader knows the interactive System
described in the System 1022 User's Reference Manual.
Host language routines have the names DBXXXX, where XXXX stands for
the identifier of the routine. For example, DBFIND is the analogue of
the FIND command. The routines are executed by the CALL statement in
FORTRAN and by the ENTER MACRO statement in COBOL. They are available
in either a reentrant (HR1022) or non-reentrant (HL1022) version.
Load your program with these libraries by a monitor level command of
the form:
LOAD file-descriptor(s), SYS:HR1022/LIB (Reentrant)
or
LOAD file-descriptor(s), SYS:HL1022/LIB (Non reentrant)
The following pages summarize the routines and indicate the parallel
command or feature in the interactive System.
USING THE SYSTEM 1022 HOST LANGUAGE INTERFACE Page 1-2
Revision 5
1.2 SUMMARY OF HOST LANGUAGE ROUTINES
The routines are in the following categories:
Initialization
Data Set Selection
Data Set Inquiry
Data Update
Special Purpose
All routines are useable from FORTRAN-IV, FORTRAN-10, FORTRAN-20,
COBOL, and MACRO, after the appropriate initialization call depending
on the host language.
Initialization Routines ______________ ________
DBCBL Initializes the COBOL interface.
DBEND Marks the end of System 1022 activities, parallel to
the QUIT command.
DBFOR Initializes the FORTRAN-10 or FORTRAN-20 interface.
DBMAC Initializes the MACRO interface.
DBSTRT Initializes the FORTRAN-IV interface.
Data Set Selection Routines ____ ___ _________ ________
DBCLOS Closes the current data set. Parallels the CLOSE
command.
DBCSET Returns the number of the current data set.
Parallels the INFORM SET command.
DBNSET Returns the number of open data sets. Parallels the
INFORM BASE command.
DBOPEN Opens one or more data sets. Parallels the OPEN
command.
DBSET Selects one of several open data sets. Parallels
the DBSET command.
USING THE SYSTEM 1022 HOST LANGUAGE INTERFACE Page 1-3
Revision 5
Data Set Inquiry Routines ____ ___ _______ ________
DBDROP Drops a record from the current selection group.
Parallels the DROP command.
DBFIND Selects records by KEYED attributes. Parallels the
FIND command.
DBGET Returns values for all attributes in a record.
DBGREC Enters Local mode for single record processing.
Parallels the GETREC command.
DBMAP Selects records from a second data set based on
common attribute values shared with the current
selection group. Parallels the MAP command.
DBNREC Returns the number of records currently selected.
Parallels the SYSNREC System variable.
DBSAVE Saves retrieval information for the currently
selected group of records. Parallels the SAVE
command.
DBSEL Is like DBSRCH, but selection is delayed until the
records are retrieved by another command. Parallels
the SELECT command.
DBSORT Sorts the currently selected records. Parallels the
SORT command.
DBSRCH Selects records from the current selection group
using any attribute values. Parallels the SEARCH
command.
DBSREC Halts single record processing and returns to Global
mode. Parallels the STARTREC command.
DBVAL Retrieves attribute values by name from a record.
Parallels the LET command.
DBVALU For a specified keyed attribute, returns each
different value and the number of times each occurs
in the current selection group. Parallels the
interactive VALUES command.
USING THE SYSTEM 1022 HOST LANGUAGE INTERFACE Page 1-4
Revision 5
Data Set Update Routines ____ ___ ______ ________
DBADD Adds a record to the data set. Parallels the
ADD command.
DBADDR Adds a record using Standard Record Format.
DBALLO Allocates disk space for new records to be added to
the data set. Parallels the ALLOCATE command.
DBBUF Allocates I/O buffers for increased efficiency
during update and retrieval activities. Parallels
the SET BUFFER command.
DBCHNG Changes the values of specified attributes for the
currently selected record(s). Parallels the
CHANGE command.
DBDEL Deletes the currently selected records from the data
set. Parallels the DELETE command.
Special Purpose Routines _______ _______ ________
DBAGET Retrieves entries from the audit trail.
DBAINI Initializes the audit file reader.
DBALOC Specifies where to begin reading an audit trail.
DBAUD Controls audit trails from Host Language programs.
DBCLR Resets internal buffer sizes following a core
expansion to handle large argument strings.
DBDATN Converts a month, day, and year to a System 1022
encoded date, the number of days since January 1,
1800.
DBDBUG Provides a call for debugging programs.
DBERR Specifies error handling procedures.
DBERRH Specifies error handling procedures.
DBERRT Types the error message for the last error that 1022
encountered.
DBEXEC Executes commands and procedures in interactive
System 1022.
DBINFO Returns information about the current data set.
Parallels the INFORM ATTRIBUTE command.
USING THE SYSTEM 1022 HOST LANGUAGE INTERFACE Page 1-5
Revision 5
DBNATT Returns the number of attributes in the current data
set.
DBNDAT Converts a System 1022 encoded date to the
corresponding month, day, and year.
DBPSWD Specifies passwords for attributes. Parallels the
PERMIT command.
DBRETN Returns to user's program after performing an error
procedure. For COBOL users only.
DBSYSV Returns or supplies the value of a System variable.
DBVAR Determines if a 1022 user variable has been defined
and returns the variable's type. If type text, it
also returns the text length.
1.3 I/O ERROR MESSAGES
The I/O error messages print detailed information about I/O errors
encountered during System 1022 operations. The messages include the
DECsystem-10 error code and the file-descriptor to which the error
corresponds.
For example, consider a DBOPEN on a data set which does not exist.
The following messages print:
1022 LOOKUP error (0) File not found File: CHECK.DMS
1022 error in routine DBOPEN called from 152
? (OP2) Data set not found
The error code (0) indicates that the file does not exist. The error
codes are described in the DEC-10 Software Notebooks, I/O programming,
Volume 4. These messages are automatic unless suppressed by using the
DBSYSV routine to set system variable SYSIOMSG equal to 1.
The following System variables allow the Host Language program to
handle errors:
NAME TYPE CONTAINS ____ ____ ________
SYSERRDEV SIXBIT Structure name or DSK.
SYSERRFILE SIXBIT File name.
SYSERREXT SIXBIT File extension.
SYSERRPPN OCTAL Project-programmer number or directory
number.
SYSERRCODE OCTAL Error code or File Status bits.
USING THE SYSTEM 1022 HOST LANGUAGE INTERFACE Page 1-6
Revision 5
Each of these values is 1 word long.
I/O error messages print for three types of errors:
o INIT UUO errors, in which the disk structure cannot be
accessed.
o LOOKUP, RENAME or ENTER UUO errors, in which the file cannot be
accessed as needed.
o Data read/write errors.
For INIT errors, the variable SYSERRDEV contains the SIXBIT structure
name. It is set to DSK if no structure name was requested.
All of these System variables are set when a LOOKUP, ENTER, or RENAME
error occurs. The variables SYSERRFILE and SYSERREXT contain the
SIXBIT file name and extension. The variable SYSERRPPN holds the
octal project-programmer number or directory number pair, with the
project number in the left halfword and the programmer number in the
right halfword.
The variable SYSERRCODE contains the integer I/O error code. These
codes are the same ones printed in the error message.
For read or write errors, the right halfword of SYSERRCODE contains
the file status bits of the file in which the error occurred, instead
of the error code. File status bits are explained in the DECsystem-10
Software Notebooks, Volume 4.
1.4 I/O EFFICIENCY -- PMAP
System 1022 running under TOPS-20 uses the TOPS-20 PMAP call to
improve most I/O efficiency.
PMAP requires buffers. By default, systems with extended section
buffers use a 64 page buffer. Systems without extended section
buffers (2020's or version 4 or earlier of TOPS-20) use the defaults
shown in the table below.
USING THE SYSTEM 1022 HOST LANGUAGE INTERFACE Page 1-7
Revision 5
Table: Buffer Defaults, Systems without Extended Sections
Pages(decimal) First Page(octal) Last Page(octal)
| COBOL 16 670 677
FORTRAN 32 600 637
MACRO 32 600 637
Stand Alone 32 600 637
You may specify different buffers for PMAP use with the FPAG., LPAG.,
and XPAG. initialization arguments. FPAG. and LPAG. specify the first
and last pages of the buffer. They are used to tune performance in
systems without extended section buffers. For example,
DBFOR('FPAG.',"600,'LPAG.',"677)
This defines a 64 page buffer between pages 600 and 677 (octal).
XPAG. specifies the number of pages of buffer. XPAG. is used in
systems with extended section buffers; specifying location is not
necessary. For example,
DBCBL USING "XPAG.","100"
Whether you specify or use the default buffers, be certain you are not
using this memory for other purposes.
When PMAP arguments and NOSETNAME (see SYSHLNAME in the DBA Manual)
are specified in the initialization call, NOSETNAME must be first.
For example,
DBFOR('NOSETNAME','XPAG.',100)
USING THE SYSTEM 1022 HOST LANGUAGE INTERFACE Page 1-8
Revision 5
CHAPTER 2
FORTRAN INTERFACE ROUTINES
2.1 RULES FOR USING THE FORTRAN INTERFACE
Calls to 1022 using Host Language Interface pass data and keywords as
arguments. These data items are:
A. Literals, which FORTRAN constructs for the user.
B. FORTRAN variables with values assigned by the program,
including text values.
C. Arrays containing data constructed by the program, usually
when there is not enough space in a simple variable to hold
the data.
System 1022 processes three forms of data:
A. Numeric binary. The value of the data item is a single
computational number in binary form, one word long.
B. ASCII. This is also called DISPLAY-7. Data is a string of
characters, as might be typed at the computer terminal. Each
character is coded into 7 bits of computer storage. Five
characters usually fit into each array location, or computer
word. In FORTRAN-7, CHARACTER data type array locations and
CHARACTER variables hold varying numbers of characters.
ASCII data is represented using the following conventions:
(1) Counted Length
(2) Delimited by Characters
a. Space Delimited and/or
b. Null Delimited
Counted Length, or "counted", means that the proper number of
characters are included in the string when it is passed as
data. There must be at least n characters in the string if
the routine expects n characters. Usually, there may be more
than n characters, in which case the extra rightmost
characters are ignored. Strings shorter than n characters
must be filled out to that length, usually with spaces. The
FORTRAN INTERFACE ROUTINES Page 2-2
Revision 5
value n is known by 1022 and is not part of the data string.
FORTRAN-7 allows character data type variables, a kind of
counted ASCII. Use the DBF6 call to initialize FORTRAN-7.
CHARACTER variables cannot be EQUIVALENCE'd to other FORTRAN
data types; so avoid using CHARACTER arrays with calls that
return mixed-type data, such as DBINFO. Set SYSHLDISP to 0
when returning data to a CHARACTER variable to ensure that
data returned is ASCII. See FXB. and PTB. below.
Delimited strings have a length determined by the first
occurrence of the delimiting character. In System 1022, this
delimiting character is the first space, or the first null
(the character with 7 bit value 0), and sometimes either one
may be the delimiter. A null delimited string may always be
formed by following the string with a zero computer word.
This places 5 null characters after the string; the first one
delimits the string. The delimiting character is not counted
as part of the data in the string.
Delimited strings may be "space filled". This means that the
last computer word used by the data characters in the string
is filled out with spaces, unless it is originally full of
data. A string is space filled by adding spaces until there
is a multiple of five characters, because each computer word
holds five characters. An additional null character (or word)
follows, when the string is "space filled, null delimited".
FORTRAN constructs a space filled, null delimited string as
the value when a quoted literal string is specified. The
program must construct the proper type of string when
constructing its own arguments in arrays.
1022 ignores Bit 35 (the last bit) in each computer word
holding an ASCII text or ASCII display value. Bit 35 is
cleared when this data is returned to the program from 1022.
C. SIXBIT. This is also called DISPLAY-6. A FORTRAN program
rarely uses this type of data; it is common in COBOL files.
SIXBIT data is a string of characters limited to the SIXBIT
character set. The SIXBIT character set is the ASCII printing
character set without lower case letters and without curly
brackets, vertical bar, accent grave, and tilde. Each
character is coded into 6 bits of computer storage. Six
characters fit into each array location or computer word.
SIXBIT data items are only "counted"; there is no delimited
pattern as with ASCII. The program may only supply SIXBIT
values as data for attributes, not as keywords or attribute
names. The last computer word of a SIXBIT value must be
filled out with null (zero) SIXBIT characters to a multiple of
6 characters. This is similar to space filling of ASCII
values.
FORTRAN INTERFACE ROUTINES Page 2-3
Revision 5
System 1022 processes five types of data which have the above forms.
The type needed for an argument is determined by the use of the value,
by what is expected in the routine, or by the setting of control
variables which specify to 1022 what form of data, and what type of
data, to expect. These types do not depend in any way on the FORTRAN
data type of the variable or array which holds the data value. The
FORTRAN data type is only important to the operation of FORTRAN
statements on the data.
In what follows, we refer to either ASCII or SIXBIT data with the term
"text", assuming the proper rules applying to the use of either one.
An item of data is "supplied" when its value is read by 1022 for
processing. It is "received" when 1022 returns a value to the program
in a variable or array. An item is "passed" to 1022 when it may be
supplied or received in the context of the discussion. The rules for
supplying and receiving an item are the same unless differences are
described.
The five data types and their properties are described below.
Wherever "variable" or "array" is mentioned, an array or variable of
the same FORTRAN type will do as well. "Array" is used when the most
common cases require more than one word of storage for the data.
A. INTEGER values are either computational or display.
Computational values are ordinary FORTRAN integer constants or
single precision variables. FORTRAN computes with this value
properly when it is stored in an INTEGER variable. A
computational integer is supplied and received in a variable,
and occupies one word of computer storage.
Display integers are text literals, or text values in arrays.
A display integer may contain leading spaces, a preceding plus
or minus sign, digits, a following plus or minus sign (if none
precedes) and trailing spaces. An all blank value is treated
as zero. An ASCII display integer is a text literal, a null
delimited text string, or a counted string of 15 characters.
A SIXBIT display integer is a counted string of 12 SIXBIT
characters.
Supply a display integer in any of the above forms.
An ASCII display integer is received in a field of 15
characters, right justified, and filled on the left with
blanks. Negative numbers have a preceding minus sign. This
occupies 3 single precision FORTRAN array locations. A SIXBIT
display integer is received in a field of 12 characters, with
preceding minus sign if negative, right justified and filled
on the left with SIXBIT null characters. This occupies 2
single precision FORTRAN array locations, or one double
precision variable. In either case, a zero value is returned
as a single 0 character on the right.
The range for integer values, either display or computational,
FORTRAN INTERFACE ROUTINES Page 2-4
Revision 5
is between + or - 34,359,738,637.
B. DOUBLE INTEGER values have the same properties as integer
values except the length and range of values are greater. An
ASCII display double integer is a counted string of 25
characters and a SIXBIT display double integer is a counted
string of 24 SIXBIT characters.
The range of double integer values, either display or
computational, is between + or -
1,180,591,620,717,411,303,423.
C. REAL values are either computational or display.
Computational values are ordinary FORTRAN real constants or
single precision variables. FORTRAN computes with this value
properly when it is stored in a single precision REAL
variable. A computational real is supplied and received in a
single variable or array location, and occupies one word of
computer storage.
Display reals are text literals, or text values in arrays.
They may contain the following characters: the digits,
optional decimal point, optional preceding sign, and optional
"E field" as in FORTRAN scientific representation. Space
characters may precede and/or follow the characters of the
number without changing its value. Spaces may not be included
between the characters of the number. A display real which is
all space characters is evaluated as zero.