Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
sunbelt-plb-samples/legacy_demo/isi$aam.pls at main · KcsDev1982/sunbelt-plb-samples · GitHub
Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
KcsDev1982
/
sunbelt-plb-samples
Public
Notifications
You must be signed in to change notification settings
Fork
2
Star
5
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Files
Expand file tree
main
Breadcrumbs
sunbelt-plb-samples
/
legacy_demo
/
isi$aam.pls
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
115 lines (115 loc) · 4.77 KB
main
Breadcrumbs
sunbelt-plb-samples
/
legacy_demo
/
isi$aam.pls
Copy path
Top
File metadata and controls
Code
Blame
115 lines (115 loc) · 4.77 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
+------------------------------------------------------------------------------
. The intent of this PROGRAM is to provide SAMPLE logic which can
. be used as an example for Reindexing or Reaamdexing data files for an
. application.
.
. This logic has intentional ERRORs built in which require the user
. to modify for a given application.
.
INPUT FILE BUFFER=8192
SEQ FORM "-1"
VAR1 DIM 5
VAR2 DIM 5
.
. Other variables would go here.
.
VARLIST VARLIST VAR1,VAR2 // ,VAR3,...
.------------------------------------------------------------------------------
. IFILE definition that will be used to PREP the new ISAM and TXT file.
.
. This must be modified to supply the correct record length if greater
. than 256
.
. If you need an AAM file instead of an ISI file, change IFILE to AFILE.
.
INDEX1 IFILE FIXED=256
KEYLEN1 FORM "10" ;Change to match INDEX1 key length
RECLEN FORM "256"
KEY1 DIM 10
.------------------------------------------------------------------------------
. Additional IFILE or AFILE file declarations go here if there are
. secondary indices on the file. Since an AAM or ISAM prep will cause
. the TXT file to be truncated to a zero length file, any reindexes
. must create any secondary AAM or ISI files at the same time that
. the original file is created.
.
.INDEX2 IFILE FIXED=256
.KEYLEN2 FORM "20" ;Change to match INDEX2 key length
.
.INDEX3 AFILE FIXED=256
.KEYSPC3 INIT "U,1-10,11-20,22" ;Change to match INDEX3 key specs
.------------------------------------------------------------------------------
. Working variables.
.
COUNT FORM 5
COUNT2 FORM 2
.------------------------------------------------------------------------------
. Step 1. Make sure the temporary file does not exist.
.
DISPLAY *HD,"PL/B Sample Indexing Program"
TRAP IGNORE IF IO
ERASE "SAMPLE.OLD"
TRAPCLR IO
.------------------------------------------------------------------------------
. Step 2. RENAME the data file to another name.
.
RENAME "SAMPLE.TXT","SAMPLE.OLD"
.------------------------------------------------------------------------------
. Step 3. OPEN the RENAMEd data file in EXCLUSIVE mode for faster access.
.
OPEN INPUT,"SAMPLE.OLD",EXCLUSIVE
.------------------------------------------------------------------------------
. Step 4. PREP all of the indices that are required.
.
DISPLAY "Indexing SAMPLE.TXT"
PREP INDEX1,"SAMPLE.TXT","SAMPLE.ISI",KEYLEN1,RECLEN
..... PREP INDEX2,"SAMPLE.TXT","SAMPLE.IS2",KEYLEN2,RECLEN
..... PREP INDEX3,"SAMPLE.TXT","SAMPLE.AAM",KEYSPEC3,RECLEN
.------------------------------------------------------------------------------
. Step 5. Read the RENAMEd data file sequentially.
.
LOOP
READ INPUT,SEQ;VARLIST
UNTIL OVER
.------------------------------------------------------------------------------
. Step 6. If an INDEX1 is an ISAM file, then create the key.
.
PACK KEY1,VAR1,VAR2
.------------------------------------------------------------------------------
. Step 7. WRITE the record to INDEX1.
.
WRITE INDEX1,KEY1;VARLIST
.------------------------------------------------------------------------------
. Step 8. Build any other keys and perform any required INSERTs.
.
..... PACK KEY2,VAR3,VAR1,VAR2
..... INSERT INDEX2,KEY2 ;ISAM FILE INSERT
..... INSERT INDEX3 ;AAM FILE INSERT
.------------------------------------------------------------------------------
. Step 9. Display record counter.
.
ADD "1",COUNT
MOVE COUNT,COUNT2
IF OVER
DISPLAY "Records: ",COUNT,*C;
ENDIF
.------------------------------------------------------------------------------
. Step 10. Repeat the process with the next record.
.
REPEAT
.------------------------------------------------------------------------------
. When an OVER is detected on the input file, we will come here.
.
CLOSE INPUT
CLOSE INDEX1
..... CLOSE INDEX2
..... CLOSE INDEX3
.------------------------------------------------------------------------------
. The REINDEX and/or REAAMDEX is now finished.
.
STOP
.------------------------------------------------------------------------------
. Trap to ignore an I/O error on the ERASE statement.
.
IGNORE
RETURN
You can’t perform that action at this time.