THE WELCH COMPANY
440 Davis Court #1602
San Francisco, CA 94111-2496
415 781 5700
rodwelch@pacbell.net


S U M M A R Y


DIARY: August 10, 2003 09:28 AM Sunday; Rod Welch

SDS organic subject structure chained indexes for memory management.

1...Summary/Objective
2...Chained Segments for Subject Indexes Fast Easy, Better Memory
....1...Develop system to segment organic subject account files.
....2...Open subject accounts from Control Field - modify the code in
....3...Sort all chained segments into single account for alphabetical
3...03501 Force New Filenames to Begin When $$ Encountered
....F1 F3 Prior Level Opens 1st Chained Index Not PSI
....Sort Subject Index Modify for Chained Segments
....Sndx Subject File Used to Construct Processor that Sorts the Data
....Novel Design Reuse Data Space for Processor to Construct New Data
....Segmented Subject Files Joined to Sort All Data on a Single Subject
4...03501.Bat Start Launch Batch to Copy Files Together
5...050409 Menu "Segment Index" New Choice for Subject Index
6...00506 Segment and Chain Current Subject Index into Smaller Parts
7...03502 Modify to Manage Indexes in Chained Segments
....Chained Segments Locate If Code Not Found
8...DOS Commands Fail Using SDS Path Delimiters for SI Solution Use Quotes


..............
Click here to comment!

CONTACTS 

SUBJECTS
Segment Subject Index into Smaller Indexes Chained Together that Fit
Chain Segmented Subject Indexes Solve Memory Problem with Indexes Se
Subject Index Segment into Small Files Chained Together Solve Memory
Virtual Memory Segment Subject Index into Smaller Indexes Chained To
Subject Index Solve Memory Problem with Indexes Segmented and Chaine
Chain Segmented Indexes for Organic Subject Structure and Start Comm
Segment Subject Index SDS Marketing Sales Points Index Into Smaller
Segment Index into Smaller Indexes that Fit SDS Memory Limitations
Chained Segments Develop New System to Segment All Indexes for Virtu

1611 -
1611 -    ..
1612 - Summary/Objective
1613 -
161301 - Follow up ref SDS 5 0000, ref SDS 4 0000.
161302 -
161303 - Improved memory management using the Subject Index by developing a
161304 - natural process for segmenting large indexes into smaller files that
161305 - do not require changing existing assignments to SDS Control Fields,
161306 - and is much less of a burden on computer memory.  The new system
161307 - maintains capability to search the entire group of chained segments,
161308 - as a single sorted index.  For this to be really helpful, need the
161309 - improvement that enables 03501 and 03502 to use the Start command,
161310 - which provides more memory and separate memory to handle the larger SI
161311 - ops, and further reduce fragmentation.
161312 -
161313 -       [On 030902 developed system to run the Subject Index in a
161314 -       separate memory session called by Windows Start command.
161315 -       ref SDS 7 0001
161317 -        ..
161318 -       [On 031028 planning system to chain segments of a full subject
161319 -       report. ref SDS 8 0001
161321 -        ..
161322 -       [On 031114 developed system of virtual memory for reading large
161323 -       indexes of any size when sorted. ref SDS 9 0001
161325 -        ..
161326 -       [On 040411 enhanced function for segmenting indexes by adding a
161327 -       feature to maintain the segment file size. ref SDS 11 0001
161329 -        ..
161330 -       [On 080511 expanded capacity of subject index 1000% from 100 to
161331 -       1000 files for account segments. ref SDS 14 NF5I
161332 -
161333 -
161334 -
161336 -  ..
1614 -
1615 -
1616 - Evaluation
1617 -
161701 - Chained Segments for Subject Indexes Fast Easy, Better Memory
161702 -
161703 - There are three (3) criteria for evaluation....
161704 -
161705 -    1.  Fast and easy to use, hard to cause a failure, with no loss of
161706 -        performance, and no need to update subject assignments to SDS
161707 -        records and documents. ref SDS 0 VO5T
161709 -         ..
161710 -    2.  Existing procedures either remain the same or are improved, so
161711 -        there is minimal learning curve -- things work better with
161712 -        existing skills. ref SDS 0 VP37
161714 -         ..
161715 -    3.  Memory management improved, shown by fewer crashes. ref SDS 0
161716 -        VP4O
161718 -  ..
161719 - Generally, the system is fast and easy to use, with no loss of
161720 - performance, and no time required to change subject code assignments
161721 - to SDS record Control Fields.  To create a chained segment merely
161722 - requires moving to a place in the index with the cursor on an account
161723 - line.  Since 95% of the lines in an index are account lines, this is
161724 - not a difficult task. Opening the menu for Subjects and clicking on...
161725 -
161726 -                        Segment Index
161727 -
161728 - ...is fairly fast and easy. ref SDS 0 Q15J  A new index segment is
161729 - created instantly, and a specification is entered into the prior level
161730 - for easy access to the new level, thus the notion of "chained"
161731 - segments.
161733 -  ..
161734 - Generally indexes are segment between accounts.  When an account is
161735 - segmented between index sub-files, then notice is entered at the
161736 - bottom of the first index...
161737 -
161738 -                Account continued next level.
161739 -
161740 - ...and at the top of the next leve....
161741 -
161742 -                Continued from prior level.
161743 -
161744 - ...so that the user is aware when using F5 that all elements are not
161745 - displayed.
161747 -  ..
161748 - This makes segmenting indexes essentially a matter of volition.  The
161749 - one time previously, when an index was segmented, it required an
161750 - entire day plus another day or two to change subject assignments to
161751 - Control Fields in SDS records, per below, ref SDS 0 QG7I, which
161752 - explains why more of this has not been done, and further supports the
161753 - general proposition that if good management can be made fast and easy,
161754 - more people will gravitate toward practices that save lives, time,
161755 - and money in the future, which is the essence of management, reported
161756 - on
161758 -  ..
161759 - A key criteria for measuring performance, in addition to ease and
161760 - speed for segmenting indexes, is opening an index from a Control
161761 - Field. The code steps through each segmented index looking for the
161762 - account specified in the Control Field.  If there are 3 or 4 segments
161763 - one might expect a pause while the code opens and searches each
161764 - segment.  Testing shows that double clicking or pressing Enter on a
161765 - control field subject spec finds the target line in the SI segment
161766 - almost before the Enter key is released no matter which segment has
161767 - the target account.  This seems adequate.
161769 -  ..
161770 - Similarly, sorting indexes occurs with equal speed.
161772 -  ..
161773 - There is no loss of prior functionality and no need to change prior
161774 - practices.  There may be some loss of utility from not have visual
161775 - continuity between the end of one segment and the beginning of
161776 - another.  Often examination of adjacent subject descriptions prompts
161777 - helpful insights.  Since the indexes can be sorted easily, this issue
161778 - is mitigated.  There is further mitigation from providing in the new
161779 - code provision for stepping back to the original SI level when using
161780 - F1 F3 for opening a prior level, when an index is opened from an SDS
161781 - record Control Field.  With this scenario, typically, using F1 F3
161782 - defaults to the Primary Subject Index (PSI), but with a chained
161783 - segmented index, the code now allows using F1 F3 to step back to the
161784 - primary level for the account.  Another idea to consider that has not
161785 - been implemented is to start at the bottom of a chained segment when
161786 - scrolling back to a prior level.
161788 -  ..
161789 - This can be implemented by placing a link to the next level at the
161790 - bottom as well as the top of a chained segment.
161792 -  ..
161793 - The primary purpose of the exercise is to reduce the incidence of
161794 - running out of memory.  Improvements today make progress on this
161795 - objective, simply because it eliminates the situation where in a large
161796 - record, to look up certain subjects previously required opening an
161797 - equally, sometimes larger SI.  Now that is eliminated, so there should
161798 - be much less "out of memory" problems.  Of course as soon as we sort
161799 - the index, the prior problem looms.  Hopefully the Start Command
161800 - improvement for SI ops will help on this condition.
161801 -
161802 -     [On 030902 system of virtual memory was developed; macro file
161803 -     03502 was eliminated and the code was put in 03501 and in 035012.
161804 -     ref SDS 7 0001
161806 -      ..
161807 -     [On 031114 developed system to chain a sorted index into smaller
161808 -     elements that solve the memory problem. ref SDS 9 PPTW
161809 -
161810 -
161811 -
161812 -
161813 -
161814 -
161815 -
161817 -  ..
1619 -
1620 -
1621 - Planning
1622 -
162201 - The task....
162202 -
162203 -    1.  Develop system to segment organic subject account files.
162204 -
162205 -        The account for "Selling points" was segmented on 980107,
162206 -        ref SDS 1 0001  This is hardwired, ref SDS 1 NQ32, which is not
162207 -        useful for our purposes today, but it shows some tasks that
162208 -        need to be addressed.
162209 -
162210 -              [On 031128 legacy system for sales points was updated.
162211 -              ref SDS 10 736N
162213 -         ..
162214 -        A new system is needed that enables users to instantly segment
162215 -        any index at any convenient location, and automatically
162216 -        construct a chained segment specification that SDS tools use to
162217 -        manage the revised structure without any extra time or effort
162218 -        by the user.  The prior method resulted in changing the account
162219 -        structure slightly, and this meant that all of these codes
162220 -        assigned to SDS records had to be found and updated, which took
162221 -        several days, as reported on 980107. ref SDS 1 4271  The new
162222 -        design today will be different, merely segmenting accounts and
162223 -        not changing any structures, so that changing assignments to
162224 -        SDS records will not be required.
162226 -               ..
162227 -              [On 031028 planning for system to chain segments of a
162228 -              full subject report. ref SDS 8 0001  Developed system on
162229 -              031028. ref SDS 8 TJ8L
162231 -               ..
162232 -              [On 040411 planning to maintain segment sizes.
162233 -              ref SDS 11 YU86
162235 -         ..
162236 -        This will hopefully reduce the burden on memory, especially if
162237 -        we can get Start to run SI ops so that fragmentation does not
162238 -        accumulate as it does in Medit ops.
162239 -
162240 -              [On 030902 applied Windows Start command for memory
162241 -              management of SDS organic structures in the Subject Index
162242 -              system. ref SDS 7 4Q83
162244 -             ..
162245 -        a.  Segment Index, ref SDS 0 QG7I, -- New Function - 00506
162246 -
162247 -            Developed 00506, ref SDS 0 FK3M, called by a new menu
162248 -            option in 050409 for Subjects. ref SDS 0 Q15J
162250 -             ..
162251 -        b.  Segment Index -- new menu call for this task.
162252 -
162253 -            User moves to a line in the current index and opens the
162254 -            Subject menu.  Click "Segment Index," and the code will
162255 -            instantly create a new segment with the user in that new
162256 -            level. ref SDS 0 Q15J
162257 -
162259 -             ..
162260 -        c.  Specification for chained segment will be appended to the
162261 -            current baseline specification in each index.
162262 -
162263 -
162264 -                f: nn nnnnn nn $$nn
162265 -                                ------
162267 -             ..
162268 -            We are already using $ for a new index, and so a double
162269 -            $$$nn seems adequate to uniquely identify a segment of the
162270 -            current index, rather than a new index.
162272 -             ..
162273 -            To identify the last segment in the chain, use....
162274 -
162275 -                f: nn nnnnn nn $$nn$
162276 -                                -------
162277 -
162279 -         ..
162280 -    2.  Open subject accounts from Control Field - modify the code in
162281 -        03502 to search chained segments.
162283 -         ..
162284 -        This will look for an account in the specified index, and if
162285 -        not found, will look for $$nn segmented account.  If there,
162286 -        this will be checked until all segmented accounts are
162287 -        inspected, and if the target specification is not found then an
162288 -        error message will be issued.
162289 -
162290 -             [On 030902 macro file 03502 was eliminated and the code
162291 -             was put in 03501 and in 035012. ref SDS 7 0001
162293 -         ..
162294 -        Modify 03501 SI profile processor to manage the new chained
162295 -        indexes....
162296 -
162297 -        a.  The chained segment filename structure is fixed, rather
162298 -            than floats, as the other indexes are constructed.
162299 -            ref SDS 0 8S3I
162301 -             ..
162302 -        b.  Prior level F1 F3 change the code to open the 1st chained
162303 -            index for the current segment when a chained index is
162304 -            opened from a Control Field, rather than the current
162305 -            default to open the Primary Subject Index, PSI. ref SDS 0
162306 -            WG3O
162307 -
162309 -         ..
162310 -    3.  Sort all chained segments into single account for alphabetical
162311 -        search, ref SDS 0 736N, similar to handling Selling Points.
162312 -
162313 -
162314 -
162315 -
162316 -
162317 -
162318 -
162320 -  ..
1624 -
1625 -
1626 - 1303
1627 -
162701 - 03501  Force New Filenames to Begin When $$ Encountered
162702 -
162703 - Follow up ref SDS 1 0Q7S.
162704 -
162705 - We are going to have a problem with the current scheme for
162706 - constructing a file index name.
162708 -  ..
162709 - Currently, the code always constructs an 8 char filename.  This design
162710 - will cause in many cases the filename for a chained segmented index to
162711 - be something like....
162712 -
162713 -       &......\$$$nn
162714 -       &.....$\$$nn
162715 -       &....$$\$nn
162716 -       &...$$$\$nn
162717 -       &..$$$n\$n
162719 -  ..
162720 - So, this is a big mess.  First task is to rig this to create a
162721 - filename using $$$nn, rather than the stuff above, ref SDS 0 AS4H, and
162722 - to identify the last chained segment by appending another $ at the
162723 - end, so it looks like $$$nn$  This gives us 100 segments.  Below,
162724 - develop procedure to manage a fixed filename structure for chained
162725 - segments. ref SDS 0 OW9K
162726 -
162727 -        [On 080511 expanded capacity of subject index from 100 to 1000
162728 -        segmented files. ref SDS 14 NF5I
162729 -
162731 -  ..
162732 - Line 70, ref OF 2 EO8I, in 03501
162733 -
162734 -    -gosub initl
162735 -
162736 -        Standard call by macro 143 in 000008 to initialize 03501 after
162737 -        03502 has run, per below. ref SDS 0 E34J
162739 -  ..
162740 - Line 40, ref OF 2 JT6G, in 03501
162741 -
162742 -    -goto 03502
162743 -
162744 -        Standard call by macro 143 in 000008 to further configure 03501
162745 -        after 03502 has run.
162746 -
162748 -  ..
162749 - Line 710, ref OF 2 S86M, -label 03506 in 03501
162750 -
162751 -    -label 03506
162752 -    of 0
162753 -    setcnt 80 0
162754 -    setcnt 86 1
162755 -    setcnt 87 46
162756 -    loc_cur 0 1
162757 -    macro 1182
162758 -
162759 -        Capture account string and stop on a dot, char 46.
162760 -
162762 -  ..
162763 - Line 730, ref OF 2 AR4L, -label jmP3 in 03501
162764 -
162765 -    -label jmP3
162766 -    e c:\sd\03\03501
162767 -    getgbl 112 112
162768 -
162769 -        Open SI processor and get the global 112 which controls 03502
162770 -        from Control Field lookup ops.
162771 -
162773 -  ..
162774 - Line 840, ref OF 2 514O, -label bH_enTr in 03501
162775 -
162776 -    -label bH_enTr
162777 -    getgbl 1 @100
162778 -    -if @1 = 32 -goto bH_i
162779 -    -if @1 = 58 -goto bH_i
162780 -
162781 -
162783 -  ..
162784 - Line 2270, ref OF 2 X47N, -label bH_enTr in 03501 about 50 lines below
162785 -
162786 -    addcnt 2 1
162787 -    -if @2 = 9 -gosub bH_dir
162788 -    -if @2 != 2 -if @1 = 36 -if @3 != 36 -gosub bH_dir
162789 -
162790 -        Here the code is building the directory and filename to open;
162791 -        currently, a new dir is only created on eight char.  Added code
162792 -        today to make a new dir when $ encountered to avoid problem
162793 -        described above. ref SDS 0 AS4H
162795 -         ..
162796 -        We might want to modify the criteria for directories, and
162797 -        instead make a new dir on strings separated by a space.  This
162798 -        might make maintenance easier, including transferring account
162799 -        codes between people.  Transferring structures now is hard
162800 -        except at the primary level.
162801 -
162802 -
162804 -     ..
162805 -    F1 F3 Prior Level Opens 1st Chained Index Not PSI
162806 -
162807 -
162808 - Line 1040, ref OF 2 XE5J, -label sTrtSI in 03501 about 40 lines below
162809 -
162810 -    getgbl 231 231
162811 -    -if @231 != 6301 -goto ncseG
162812 -    setgbl 231 0
162813 -
162814 -        Global 231 6301 is set in 03502 to establish this is a control
162815 -        field look up, ref SDS 0 223F, and so 03501 will process this
162816 -        code once for a chained segment, if one was opened, to enable
162817 -        F1 F3 to step back to first level, rather than default to the
162818 -        PSI.
162820 -     ..
162821 -    errorcnt 0 0
162822 -    z 1 80
162823 -    fl /$$$/
162824 -    -if @0 > 0 -goto ncseG
162825 -
162826 -        Add code for 03502 op, per below, to see if this is a chained
162827 -        segment file, ref SDS 0 223F; if not proceed to normal
162828 -        processing -goto ncseG. ref SDS 0 GB5H
162829 -
162830 -           [On 061124 this code was supersceded a year or so later, but
162831 -           was left in the macro code; was then applied to navigate
162832 -           chained indexes by incrementing the filename, rather than
162833 -           stack the entry each pass. ref SDS 13 ML4J
162835 -  ..
162836 - Line 1050, ref OF 2 2B6J, -label sTrtSI in 03501 about 40 lines below
162837 -
162838 -    immed r
162839 -    rel_cur 1 0
162840 -    ins_text !            !
162841 -    fl /&/
162842 -    ic 36
162843 -    loc_cur 5 1
162844 -    ic 42
162845 -    rel_cur 10 0
162846 -    immed d
162847 -
162848 -        Repeat the line to create a command to step back to the first
162849 -        level of a chained segment.  Move the cursor down to the new
162850 -        line.  It is already on the column for $$$nn, from the code
162851 -        above. ref SDS 0 WG3O   Shear off the chained segment filename,
162852 -        and then locate the dir symbol, &, and change this to a
162853 -        filename symbol $.
162855 -         ..
162856 -        This implements a philosophy that says if the user steps back,
162857 -        then go back to the primary level, and if the user wants an
162858 -        intermediate level, then can step forward using the account for
162859 -        a Chained Segment that is in that index.
162861 -         ..
162862 -        The code is already wired to comment out the g command in
162863 -        column on the next line, so, since a new line is added with
162864 -        this new code, there are two lines to comment out and to adjust
162865 -        the stack of 10 levels.  Therefore, jump down and comment out
162866 -        the 2nd line, and let the next code do the first one.
162867 -        Similarly, move the cursor down to line 10 and delete it to
162868 -        maintain the stack, and the existing code will then still work.
162869 -
162870 -
162872 -  ..
162873 - Line 1060, ref OF 2 HH8H, -label ncseG  in 03501
162874 -
162875 -    -label ncseG
162876 -    loc_cur 4 1
162877 -    ic 42
162878 -
162879 -        Existing code removes extra line in stack to scroll through SI
162880 -        indexes.
162881 -
162882 -
162884 -  ..
162885 - Line 1120, ref OF 2 JJ3F, -label bH_dFlt in 03501 about 40 lines
162886 - below
162887 -
162888 -    -label bH_dFlt
162889 -    G h:\sd\06\00000\
162890 -    -if @120 = 938 g stufq10
162891 -
162892 -        The standard code for moving to a new index will open an empty
162893 -        index, when a segment chain is being constructed.  Macro file
162894 -        00506 sets 120 983, ref SDS 0 US6I, per below, and in that case
162895 -        read in stufq10 which is saved by 00506. ref SDS 0 RG4K
162896 -
162897 -
162898 -
162899 -
162900 -
1630 -

SUBJECTS
Novel Design Combined Code to Sort Files for New System of Segmenting
Segmented Subject Indexes Sort that Fit Medit Memory Limitations Use

1804 -
180501 -     ..
180502 -    Sort Subject Index Modify for Chained Segments
180503 -
180504 -
180505 - Line 2470, ref OF 2 4898, -label sortIt in 03501
180506 -
180507 -    This code is called when "Sort" is selected from the menu in the
180508 -    Subject Index for finding a subject to enter into an SDS record
180509 -    control field or to run a subject report to find information.
180510 -
180511 -
180513 -  ..
180514 - Line 2520, ref OF 2 GZ7H, -label sortIt in 03501 about 60 lines below
180515 -
180516 -    dose/c c:\sd\01\s i 256 cr; cf h:\sd\06\00101\$01051X > nul:
180518 -         ..
180519 -        Selling points SI are sorted with the Supersort command
180520 -        file...
180521 -
180522 -                     h:\sd\06\00101\$01051X
180523 -
180524 -        ...which is a Supersort op, ref OF 10
180525 -        that has...
180526 -
180528 -     ..
180529 -    Sndx Subject File Used to Construct Processor that Sorts the Data
180530 -    Novel Design Reuse Data Space for Processor to Construct New Data
180531 -    Segmented Subject Files Joined to Sort All Data on a Single Subject
180532 -
180533 -
180534 - Line 2610, ref OF 2 WR5H, -label fdolsn in 03501
180535 -
180536 -    Build a batch file in sndx to save memory from opening another file
180537 -    to glue the base index together with the chained segment files, as
180538 -    follows......
180539 -
180540 -       copy "h:\sd\06\00101\&0300050\$01CKEGC" tqib
180541 -       copy "h:\sd\06\00101\&0300050\&01CKEGC\$$$*"+tqib tqia
180542 -       goto end
180543 -       Dr Directory                           DESCRIPTION
180544 -       == =============================================================================
180545 -       f  03 00050 01 CKEGC...................... Demand
180546 -       :end
180548 -     ..
180549 -    save stufqj.bat
180550 -    **
180551 -       dose/c stufqj.bat
180552 -       dose/c c:\sd\10\stufqj.bat
180554 -     ..
180555 -    dose/c c:\sd\01\03501a.bat
180556 -
180557 -       This is a novel way to construct a processor by removing data to
180558 -       be processed from a file, sndx, and using the space already
180559 -       reserved in memory for the data to then assemble commands in
180560 -       sndx for a temporary batch file stufqj.bat.  Then execute the
180561 -       batch file to copy the files into a single file for sorting, and
180562 -       then removing the commands and reading back the processed data.
180563 -
180564 -           [On 031114 modified to include the sort command in
180565 -           stufqj.bat. ref SDS 9 NB8M
180567 -        ..
180568 -       Initially, this scheme was failing, as explained below,
180569 -       ref SDS 0 UG9G  Gary Johnson noticed that adding quotes to the
180570 -       arguments solves the problem. ref SDS 0 O66J
180572 -        ..
180573 -       Subsequently, the first two forms of a dose op failed, even
180574 -       though we do the same thing throughout the SDS code, per below.
180575 -       ref SDS 0 DE9O
180577 -        ..
180578 -       Maybe we can do this with a permanent 03501 start command op.
180580 -        ..
180581 -       This finally worked after about 4 hours of experimenting.
180582 -
180583 -
180585 -  ..
180586 - 03501.Bat  Start Launch Batch to Copy Files Together
180587 -
180588 - Line  30, ref OF 8 WO4N, in c: sd 01 03501a.bat
180589 -
180590 -    %systemroot%\system32\cmd.exe /C start /min /wait c:\sd\10\stufqj.bat
180591 -
180592 -       Trying this approach.
180594 -        ..
180595 -       Seems to work.
180596 -
180597 -
180598 -
180600 -  ..
180601 - 050409  Menu "Segment Index" New Choice for Subject Index
180602 -
180603 - Rather than do this manually, can automate the mechanics.
180605 -  ..
180606 - User will execute the function on a line in the current index, and
180607 - that line and everything below will be moved to a new index segment.
180609 -  ..
180610 - Line 160, ref OF 6 LY7F, -label subjQ in 050409 about 60 lines below
180611 -
180612 -    ins_text " Segment Index                        "
180613 -    loc_cur 0 80
180614 -    ins_text " @C:\SD\03\00506   "
180615 -    rel_cur 1 -65
180616 -
180617 -        Changed code today from calling macro file 00501 at this
180618 -        location which creates directory path structure for the current
180619 -        level in the SI.  We don't need this anymore because now savx
180620 -        does that task.  Instead call a new macro file 00506 that
180621 -        will segment the current index at the current line and create a
180622 -        new index.
180623 -
180624 -
180626 -  ..
180627 - 00506  Segment and Chain Current Subject Index into Smaller Parts
180628 -
180629 - Automate task of segmenting an index and creating a pointer in the
180630 - index to the new segment. ref SDS 0 539K
180631 -
180632 -            [On 060622 added feature to call Windows Explorer to get
180633 -            list of subject index files at current account level to
180634 -            guage number of lines to move between indexes that creates
180635 -            file sizes, reducing chances of exceeding memory limits of
180636 -            SDS (Medit). ref SDS 12 0001
180638 -  ..
180639 - Line  30, ref OF 1 RE6H, -label segmnt in 00506
180640 -
180641 -    -label segmnt
180642 -    ic 37
180643 -    save stufq10
180644 -    immed 9999d
180645 -    down
180646 -    immed a
180647 -
180648 -        Enter % char to identify where to delete for building the next
180649 -        segment.  Save the current index to file stufq10 with the %
180650 -        flag showing where the content for the next level begins, so
180651 -        this can be used to construct the next chained segment.  After
180652 -        saving the full index for the next level, delete everything
180653 -        from and below the line with the % flag.  Add a blank line at
180654 -        bottom to complete constructing the new chained segment.
180656 -             ..
180657 -            [On 080511 expanded capacity of subject index 1000% from
180658 -            100 to 1000 files for account segments. ref SDS 14 NF5I
180659 -
180661 -  ..
180662 - Line 190, ref OF 1 G99N, -label icur37 in 00506
180663 -
180664 -    -label incur37
180665 -
180666 -    setcnt 0 0
180667 -    macro 14
180668 -    rel_cur -2 0
180669 -    fr /./
180670 -    setcur 1 0
180671 -    z 3 @1
180672 -    zonereps 2 0
180673 -
180674 -        This code will check to see if an account is being split, and
180675 -        so needs a comment at the bottom of the revised index.
180676 -        rel_cur -2 0 moves up 2 lines and gets the zone for zonereps
180677 -        command.
180679 -     ..
180680 -    macro 15
180681 -    repscnt 1 0
180682 -    -if @1 = 0 -goto acnl4.......................... ref SDS 0 GG3N
180683 -    -goto ancl3..................................... ref SDS 0 GG4N
180684 -
180685 -        Restore cursor to initial position and if repscnt 1 0 sees the
180686 -        account is the same, then do routine that adds notice.
180688 -     ..
180689 -    -label acnl4
180690 -    rel_cur -1 0
180691 -    immed 2a
180692 -    rel_cur 1 18
180693 -    ins_text "Account continued next level."
180694 -    macro 15
180695 -    rel_cur 2 0
180697 -     ..
180698 -    setcnt 91 9199
180699 -
180700 -        Code determined an account is being split, so enter notice,
180701 -        and create a flag to enter notice in the next level.
180702 -
180704 -     ..
180705 -    -label ancl3
180706 -
180707 -        Original code continues.
180708 -
180710 -  ..
180711 - Line 690, ref OF 1 NG5I, in 00506
180712 -
180713 -    top
180714 -    tl 3
180715 -    loc_cur @5 20
180716 -    fr /.. /
180717 -    -if @91 != 9199 -goto savnw
180718 -    -gosub cfpl
180719 -
180720 -    -label savnw
180721 -
180722 -        This code checks for flag set when splitting an account, and
180723 -        if so then adds notice that the first account continues from
180724 -        prior level.
180725 -
180726 -
180728 -  ..
180729 - Line 460, ref OF 1 6Q6I, -label cfpl in 00506
180730 -
180731 -    -label cfpl
180732 -    setcnt 91 0
180733 -    macro 12
180734 -    immed 2a
180735 -    rel_cur 2 0
180736 -    loc_cur 0 20
180737 -    ins_text "Continued from prior level."
180738 -    macro 13
180739 -    -return
180740 -
180741 -        Subroutine to enter notice when account is split from prior
180742 -        level, based on flag set above. ref SDS 0 GG4M
180743 -
180745 -  ..
180746 - Line 340, ref OF 1 NL5J, -label prior5 in 00506
180747 -
180748 -    -if @91 = 9199 -gosub cfpl
180749 -
180750 -        Added call to subroutine that enters notice of continuing
180751 -        account from prior level, when counter 91 flag is set, per
180752 -        above. ref SDS 0 GG4M
180753 -
180754 -
180755 -
180757 -  ..
180758 - Line 570, ref OF 1 WM4G, -label lpdt in 00506 about 40 lines below
180759 -
180760 -    save stufq10
180761 -    macro 18
180762 -    immed c
180763 -    macro 23
180764 -
180765 -        Write the current index file with a chained segment set for the
180766 -        next level to the disk to be read into for editing to create
180767 -        the next level.  Save the location where the segment can be
180768 -        incremented.  Set up to copy this line to the bottom of the new
180769 -        index so there is access to the next level at the top and
180770 -        bottom of a segmented index, and to alert the user when working
180771 -        quickly and observing the bottom of an index, that this is the
180772 -        end of the index, but rather is only the end of the current
180773 -        segment.   Then, return to the initial location with macro 23
180774 -        where the segment was executed, because this is end of the new
180775 -        segment.
180776 -
180778 -  ..
180779 - Line 640, ref OF 1 UR6G, -label lpdt in 00506
180780 -
180781 -    setcnt 120 938
180782 -    @c:\sd\03\03501 #2
180783 -    macro 3
180784 -
180785 -        Set a flag to step out of the standard code for opening
180786 -        another index level.  The code here will read the segment spec
180787 -        to load the get command, in 03501, per above.
180788 -        which is needed to load the savx
180789 -        command.
180790 -
180792 -  ..
180793 - Line 600, ref OF 1 RF5J, -label lpdt in 00506
180794 -
180795 -    setcnt 1 @131
180796 -    -if @1 < 10 ic 48
180797 -    inscnt 1 0
180798 -    macro 15
180799 -    setcnt 121 0
180800 -    -if @1 < 10 ic 48
180801 -    inscnt 1 0
180802 -
180803 -        Changed the command -if @1 < 9 ... to -if @1 < 10 so that the
180804 -        transition from 9 to 10 indexes will work.
180805 -
180806 -
180808 -  ..
180809 - Line 2650, ref OF 2 JJ3F -label cfsio in 03501
180810 -
180811 -    -label cfsio
180812 -    errorcnt 0 0
180813 -    -if @120 != 938 -goto ewfwri
180814 -    g stufq10
180815 -    -goto lKay
180817 -         ..
180818 -        120 is set to 938 when 03501 is called to open the next level
180819 -        to create a new segmented index by 00506, per above.
180820 -        ref SDS 0 US6I
180821 -
180822 -
180823 -
180824 -
180825 -
1809 -

SUBJECTS
Control Field Code "look-up," - 03502
Civilization Cost Benefit Study SDS Com Metrics Knowledge Management
Advertise Teach Com Metrics KM Intelligence Enable Culture of Knowled

2005 -
200601 -  ..
200602 - 03502  Modify to Manage Indexes in Chained Segments
200603 -
200604 - This works exactly as before.  If an account is not found in and
200605 - index, then the code will look for an account that identifies a
200606 - chained segment, identified using format developed today with 00506,
200607 - per above. ref SDS 0 FK3M  If found, then the segment will be opened
200608 - based on the specification.  If the account ends with a $ symbol, this
200609 - means there are no more chained segments and the code will end this op
200610 - and do the next step in looking for a code.  If the account does not
200611 - end with a $ then the code will open the next chained segment, and on
200612 - the first pass, it will set up the initial level of this account as an
200613 - option for the user to return to that level.  This changes processing
200614 - slightly.  Previously, returning to a prior level after opening an
200615 - account from an SDS record control field, only landed the user at the
200616 - primary subject index, PSI.  That is because the way that codes are
200617 - constructed, there a great many ways that the actual filename could
200618 - occur.  So, going back back without any history in the stack is
200619 - problematic, except now chained indexes have a set structure, so we
200620 - can accommodate this new condition, and it might be helpful.  Probably
200621 - is not a big productivity thing, because the user can easily close the
200622 - SI and open it again by clicking between the next level, then step
200623 - into the primary level at issue with F1 F2.  Basically we save 2
200624 - keystrokes, pressing ESC and then pressing Enter or double clicking to
200625 - open the SI again.
200626 -
200628 -  ..
200629 - Line 790, ref OF 3 UO8H, -label gF_dFlt in 03502
200630 -
200631 -    get-h:\sd\06\00000\
200632 -
200633 -        Load sndx with the directory and filename for the subject
200634 -        account specified in the Control Field.
200635 -
200637 -  ..
200638 - Line 930, ref OF 3 464G, -label lKay in 03502 about 30 lines below
200639 -
200640 -    -if @129 > 0 -goto csloc
200641 -
200642 -        Added this code to jump the procedure for entering the subject
200643 -        account into the locate command, because it is already loaded.
200644 -
200645 -
200647 -     ..
200648 -    Chained Segments Locate If Code Not Found
200649 -
200650 -
200651 - Line 1000, ref OF 3 RR4L, -label gF_648 in 03502
200652 -
200653 -    -label gF_648
200654 -    zone 4 5
200655 -    L !
200656 -    -label gF_f
200657 -    -if @0 = 0 -goto prg1
200658 -    top
200659 -    z 10 60
200660 -    l /$$/
200661 -    -if @0 > 1 -goto mSTR
200662 -
200663 -        Zone the exact length of the account, then look for the string
200664 -        entered from the Control Field.  If the code is found in this
200665 -        index, then proceed to -label prg1. ref SDS 0 223F  If the code
200666 -        is not in this index, first look for a chained segment; from
200667 -        top of file, zone to search for unique string $$ that is
200668 -        adopted to identify a chained segment. ref SDS 0 3S4I  Look for
200669 -        the string, and if it is not found, then proceed to do existing
200670 -        code that checks for a Master Index.
200671 -
200673 -  ..
200674 - Line 1020, ref OF 3 X56K, -label gF_f in 03502
200675 -
200676 -    loc_cur 3 1
200677 -    fr /$$/
200678 -    strcnt 129 2
200679 -    rel_cur 0 2
200680 -    chrcnt 133 0
200681 -    -if @133 = 36 -goto wSTRd
200682 -
200683 -        Find the chained segment filename ID, and capture the segment
200684 -        number in counter 129 for the next level, see below.
200685 -        ref SDS 0 XS7M  Check the last position for another $ symbol
200686 -        to see if this is the last segment.  If there is a $ at the end
200687 -        of the account, then this is the last segment, so this part of
200688 -        the code is over, -goto wSTRd. ref SDS 0 ZL7N
200689 -
200690 -
200692 -  ..
200693 - Line 1060, ref OF 3 FH6M, -label gF_f in 03502 about 60 lines below
200694 -
200695 -    setgbl 129 @129
200696 -    e c:\sd\03\03502
200697 -    line
200698 -      loc_cur 3 1
200699 -    z 1 60
200700 -    fr /$/
200701 -    rel_cur 0 -1
200702 -    macro 22
200703 -    ic 38
200704 -
200705 -        Move chained segment number to global for constructing the
200706 -        filename to get.  Open processor and move to get command line.
200707 -        Put the cursor on that line in col 1, and zone to find the
200708 -        beginning of the filename which always starts with $.  Backup
200709 -        and mark the location so we can come back and restore the
200710 -        original condition.  Change $ to & to look in the directory to
200711 -        get the chained segment file.
200712 -
200713 -
200715 -  ..
200716 - Line 1080, ref OF 3 YP9M, -label gF_f in 03502 about 90 lines below
200717 -
200718 -    eol
200719 -    savescr 16
200720 -    ic 36
200721 -    ic 36
200722 -    ic 36
200723 -    getgbl 1 129
200724 -    -if @1 < 9 ic 48
200725 -    inscnt 1 0
200726 -
200727 -        Jump to the end of the current entry for the get command, which
200728 -        has now been converted to a directory, and enter the filename
200729 -        which begins with $$$ then the chained segment number in
200730 -        counter 129 read from sndx, per above. ref SDS 0 XY3K
200731 -
200733 -  ..
200734 - Line 1090, ref OF 3 SP3O, -label gF_f in 03502 about 100 lines below
200735 -
200736 -    e sndx
200737 -    macro 3
200738 -    -goto gF_dFlt
200739 -
200740 -        Now that the get command has been modified to open a chained
200741 -        segment, return to sndx, empty the file, and goto gF_dFlt where
200742 -        the get command is executed. ref SDS 0 NY5I
200743 -
200744 -
200746 -  ..
200747 - Line 1100, ref OF 3 Q28I, -label wSTRd in 03502
200748 -
200749 -    -label wSTRd
200750 -    e c:\sd\03\03502
200751 -    macro 23
200752 -    ic 36
200753 -    getscr 16
200754 -    ins_text !          !
200755 -
200756 -        This means we have reached the end of the chained segments, so
200757 -        restore the get command by switching the & to $ and removing
200758 -        the chained segment filename.
200759 -
200761 -  ..
200762 - Line 1200, ref OF 3 3Z9F, -label prg1 in 03502
200763 -
200764 -    -label prg1
200765 -    e c:\sd\03\03502
200766 -    line                                                       && get-h
200767 -    loc_cur 3 4
200768 -    ic 32
200769 -    loc_cur 3 14
200770 -    setcnt 86 1
200771 -    macro 1182
200772 -    setgbl 231 6301
200773 -    e sndx
200775 -         ..
200776 -        Capture SI string for 03501 to manage having the SI open.
200778 -         ..
200779 -        This code ends and macro 143 then calls 03501 to set up the
200780 -        profile and enter the si file spec based on the content just
200781 -        captured from 03502.  Flag setgbl 231 6301 is used in 03501 to
200782 -        create a one time extra entry in the file stack so the user can
200783 -        use F1 F3 to step back to the initial level of a chained
200784 -        segment, when the 03502 opens a segment rather than the main
200785 -        file.  We need to edit this spec in 03501 so the user can at
200786 -        least switch between chained segments. ref SDS 0 WG3O
200788 -         ..
200789 -        When processing in 03502 ends, macro 143 in 000008 calls 03501
200790 -        #16 to initialize ops. see above, ref SDS 0 EP7F
200791 -
200792 -
200793 -
200794 -
2008 -

SUBJECTS
DOS Commands Fail on Path with & and $ Because these are Delimiters
DOSE Failing to Execute Commands from Within Medit

2204 -
220501 -  ..
220502 - DOS Commands Fail Using SDS Path Delimiters for SI Solution Use Quotes
220503 -
220504 - As explained above, ref SDS 0 UP9N, the following dos batch file is
220505 - failing...
220506 -
220507 -       copy h:\sd\06\00101\&0300050\$01CKEGC tqib
220508 -       copy h:\sd\06\00101\&0300050\&01CKEGC\$$$*+tqib tqia
220509 -       goto end
220510 -       Dr Directory                           DESCRIPTION
220511 -       == =============================================================================
220512 -       f  03 00050 01 CKEGC...................... Demand
220513 -       :end
220515 -     ..
220516 -    The front part of sndx is saved for the header in the sorted file.
220518 -     ..
220519 -    The DOS copy op is not executing properly.  The command...
220520 -
220521 -       copy h:\sd\06\00101\&0300050\$01CKEGC tqib
220522 -
220523 -    ...is copying all of the files at...
220524 -
220525 -       h:\sd\06\00101
220526 -
220527 -    ...into the current directory, which is several hundred, rather
220528 -    than copying the file
220529 -
220530 -       ....$01CKEGC to tqib
220531 -                       ----
220532 -
220533 -    ...in conformance with Microsoft guidance in Help, e.g.,...
220534 -
220535 -                 C>help copy
220537 -     ..
220538 -    Additionally, at the DOS prompt, the following command...
220539 -
220540 -       e h:\sd\06\00101\&0300050\$01CKEGC
220541 -
220542 -    ...gives this incorrect result is....
220543 -
220544 -       h:\sd\06\00101
220545 -
220546 -    ...which is an empty directory, but if the same command is called
220547 -    in SDS, the code opens the file....
220548 -
220549 -                          $01CKEGC
220550 -
220551 -    ...as expected.  Similarly, if the spec is pasted into the SDS
220552 -    file management window opened with F1 F3....
220553 -
220554 -       h:\sd\06\00101\&0300050\
220555 -
220556 -    ...yields a list of files at that address, and they can opened with
220557 -    standard SDS tools by pressing Enter or double clicking.
220559 -     ..
220560 -    This seems like a command interpreter issue of some sort where a
220561 -    switch or something needs to be set.  Guidance on this is not
220562 -    evident.
220564 -     ..
220565 -    Seems like something like this has occurred previously.
220566 -
220567 -          dose with dir failed.............. 021230, ref SDS 2 PQUY
220569 -     ..
220570 -    Sent an email to Gary for input; included the test batch file that
220571 -    is crashing.
220572 -
220574 -  ..
2206 -
2207 -
2208 - 1745
2209 -
220901 - Called Gary.  He received the email and reviewed the problem.
220902 -
220903 - Gary noted that "&" and "$" are delimiters for for DOS commands, and
220904 - so when commands are used to operate on a path and filename then
220905 - the arguments must be enclosed in quotes, thus....
220907 -        ..
220908 -       copy "h:\sd\06\00101\&0300050\$01CKEGC" tqib
220909 -       copy "h:\sd\06\00101\&0300050\&01CKEGC\$$$*+tqib" tqia
220910 -       goto end
220911 -       Dr Directory                           DESCRIPTION
220912 -       == =============================================================================
220913 -       f  03 00050 01 CKEGC...................... Demand
220914 -       :end
220916 -  ..
220917 - Testing seems to show this solves the problem.
220919 -  ..
220920 - Applied the solution. ref SDS 0 UP9N
220921 -
220923 -  ..
2210 -
2211 -
2212 - 1814
2213 -
221301 - Another problem occurred using dose command, similar to the report on
221302 - 021230. ref SDS 2 PQUY
221304 -  ..
221305 - Tried a number of ways to get dose to run a batch file, and getting
221306 - consistent failure.  Macro 01 04 06080 has a call....
221307 -
221308 -                dose /c c:\sd\01\070405.bat
221309 -
221310 - ...at about line 190, ref OF 7 TJ5J, which is used maybe 20 times a
221311 - day; similarly, 01 04 047020 has a call...
221313 -                 ..
221314 -                dose /c c:\sd\01\25.bat
221315 -
221316 - ...at about line 2310, ref OF 5 7650, is called at least once a day;
221317 - so, why the identical call in 03501....
221319 -                 ..
221320 -                dose /c stufqj.bat
221321 -
221322 -    ...or...
221324 -                 ..
221325 -                dose /c c:\sd\10\stufqj.bat
221327 -  ..
221328 - ...should be a problem is not clear.
221330 -      ..
221331 -     [On 030812 c13 is infected by a virus; perhaps problems today are
221332 -     a symptom. ref SDS 6 SZ3I
221334 -  ..
221335 - Finally cobbled something together with start command, per above.
221336 - ref SDS 0 LS6T
221337 -
221338 -
221339 -
221340 -
221341 -
221342 -
221343 -
221344 -
221345 -
221346 -
221347 -
2214 -