THE WELCH COMPANY
440 Davis Court #1602
San Francisco, CA 94111-2496
415 781 5700


S U M M A R Y


DIARY: October 4, 2002 02:11 PM Friday; Rod Welch

SDS improve feature to create new subjects using project template.

1...Summary/Objective
2...Review of Issues
3...Concepts and Planning
........Convert at Primary Project Level Rather at Sublevel
...............................03 00050
...............................03 00050
4...03505 Template for New Primary Account Using Existing Structure
5...03505 Alternate Scheme
6...SF - Morris' File Find Program Seems to Be Broke

ACTION ITEMS.................. Click here to comment!

1...Research shows following two accounts need to be removed from the

CONTACTS 

SUBJECTS
Copy Sub-levels from Sample to New Project
Set up standard project accounts

0504 -    ..
0505 - Summary/Objective
0506 -
050601 - Follow up ref SDS 18 0000, ref SDS 15 0000.
050602 -
050603 - Invested two days and got this thing to replicate the SDS subject
050604 - index to another project account we can use for Gary.  Hopefully it is
050605 - useful for a general project template function.  The old system worked
050606 - pretty well, but could not handle the SDS size of the SDS subjects.
050607 - Now that we have something that will do it, would like it be a general
050608 - tool.
050609 -
050610 -
050611 -
050612 -
050613 -
050614 -
050615 -  ..
0507 -
0508 -
0509 - Progress
0510 -
051001 - Review of Issues
051002 -
051003 - Yesterday, I started creating subjects on Gary's new project to learn,
051004 - use and evaluate SDS, based on sending him a CD on 020924. ref SDS 19
051005 - 0001  For convenience, the work yesterday of setting up subjects for
051006 - Gary is reported in the record on 021002. ref SDS 20 3R8O
051007 -
051008 -  ..
051009 - Initially, yesterday, I tried setting up a project account under
051010 - Contacts for Gary, where SDS is under Projects and has the same
051011 - subaccounts as in 03 00050.  I did this using cut and paste, then
051012 - after several hours, realized this was not a good method, because it
051013 - would take a day or so.
051014 -
051015 - Decided it would be easier to use the new project template function
051016 - in Subjects that is called from the menu for "Subjects".
051017 -
051018 - This system seems to be broke today.  Trying to copy subjects from...
051019 -
051020 -                f: 03 00050
051021 -
051022 -                f: 04 00074
051023 -
051024 - ...based on planning shown on 021002. ref SDS 20 KQ6K
051025 -
051026 -  ..
051027 - It created 326 of 382 files, which is maybe 20,000 subjects, so it got
051028 - most of them.  New users typically don't need to start out using this
051029 - level of detail, but for Gary wanted to try this as a simple way to
051030 - set up issues for learning, work and discussion.  Eventually, we will
051031 - wind up discussing everything in the SDS subject structure.
051032 -
051033 - Another problem is that to be confronted with the whold thing right
051034 - away is more confusing than enlightening, because without background
051035 - and experience the listing and descriptions are not meaningful in the
051036 - beginning.
051037 -
051038 - Never-the-less, decided to try this, and since it cannot process all
051039 - of the SDS subjects, the first step is to revise the code.
051040 -
051041 - We can set a flag to execute debug at file 325 and see what happens on
051042 - the next two files. My guess is that Medit memory fails, because we
051043 - have to load some big files. These occur early in the process, and so
051044 - they are created, but by the time file 326 roles around memory is so
051045 - fragmented that the thing cannot open another file, no matter how
051046 - small it is.
051047 -
051048 -  ..
051049 - Research shows following two accounts need to be removed from the
051050 - primary system on c13 in San Francisco...
051051 -
051052 -
051053 -                    f: 04 06069
051054 -                    f: 04 SMP01
051055 -
051056 -  ..
051057 - The first one is blank, and the second was an experiment 4 or 5 years
051058 - ago that is no longer needed, and so should have been deleted, but was
051059 - removed from the listing, without deleting the directories from the
051060 - disk.
051061 -
051062 -
051063 -  ..
051064 - Concepts and Planning
051065 -
051066 - On 930331 this capability was developed; the record for 930331
051067 - explains objectives for using project subject accounts as templates to
051068 - create subjects for new projects. ref SDS 7 5L7O and ref SDS 7 YH9F
051069 -
051070 - Review of work on 931105 is not very clear at this remove. ref SDS 11
051071 - 0001
051072 -
051073 -  ..
051074 - User interface....
051075 -
051076 -      User will first identify the new project line as the target for
051077 -      replication by entering Mark 2 (Alt F2).
051078 -
051079 -       ..
051080 -      Move the file and the cursor to the line with the project that
051081 -      has accounts to be replicated.
051082 -
051083 -               Open menu. Select
051084 -
051085 -                  Subjects
051086 -                  New Project Template
051087 -
051088 -
051089 -  ..
051090 - Process....
051091 -
051092 -    1.  Primary process is...
051093 -
051094 -        a.  Use sf.exe to create a list of subject index files for the
051095 -            template project.
051096 -
051097 -        b.  Open each file in the list using char read to capture the
051098 -            disk directory and filename string.
051099 -
051100 -        c.  In each file, change the internal structure at the project
051101 -            level from the template string to identify the new project.
051102 -
051103 -        d.  Use savx to write the modified file to the directory for
051104 -            the new project.
051105 -
051106 -         ..
051107 -        Use "nested" processing where the setup is done in the current
051108 -        level, and the file conversion process will be done under a
051109 -        dose secondary session that starts with fresh memory.
051110 -        ref SDS 0 YU6F
051111 -
051112 -         ..
051113 -        Based on analysis reported on 930331, ref SDS 7 8R8N, decided
051114 -        to hardwire the code for replicating subject accounts at the
051115 -        project level, since that is the biggest need for this feature.
051116 -        It takes the most time to replicate manually an account at the
051117 -        project level.  Other structures can be transferred, when
051118 -        necessary, using cut and paste.
051119 -
051120 -         ..
051121 -        Convert at Primary Project Level Rather at Sublevel
051122 -
051123 -        Made a slight improvement from work on 930331.  The prior work
051124 -        only seems to have operated on the 5 position project account.
051125 -
051126 -                               03 00050
051127 -
051128 -         ..
051129 -        Changed this today to process the initial two (2) position
051130 -        primary account identification field, so that essentially we
051131 -        are going to handle the first directory level of accounts,
051132 -        which is eight (8) characters...
051133 -
051134 -                               03 00050
051135 -
051136 -         ..
051137 -        This supports copying subject codes from 03 to 04 projects,
051138 -        rather than being limited to only structures within each
051139 -        project type.  It came up on 021002 because we want to conform
051140 -        the codes in the SDS project 03 00050 to a small job account
051141 -        for Gary Johnson which is under 04. ref SDS 20 KQ6K
051142 -        ..
051143 -        Changed the code today to recognize when the first level
051144 -        is a filename, and then convert to get all files under the
051145 -        directory with the same name.
051146 -
051147 -         ..
051148 -        This means six (6) place code structures are needed to run the
051149 -        operation, like...
051150 -
051151 -              03 00050
051152 -
051153 -              05 000005
051154 -
051155 -              02 03 05
051156 -
051157 -        This is not an elegant solution, but for now it is useful.
051158 -
051159 -         ..
051160 -    2.  Errors and alerts.
051161 -
051162 -        Verify that the User entered Mark 2 for the target line, and if
051163 -        not, return an error message. ref SDS 0 UW5L
051164 -
051165 -         ..
051166 -        Verify the User selected an account for the project template
051167 -        that has the right structure for a project, ref SDS 0 KL6M, and
051168 -        that the account is a directory shown by a disk drive.
051169 -        ref SDS 0 HX8N
051170 -
051171 -         ..
051172 -        Verify the User has entered a narrative description for
051173 -        the new project, and if not stop and return error message.
051174 -        ref SDS 0 SL6O
051175 -
051176 -         ..
051177 -    3.  Capture the directory structure for the template project.
051178 -        ref SDS 0 TT7N
051179 -
051180 -        Open the 03505 processor and post the User ID to the e command
051181 -        and purge command, and post the account structure to the change
051182 -        command. ref SDS 0 B19J
051183 -
051184 -
051185 -
051186 -
051187 -
051188 -
051189 -  ..
051190 - 03505 Template for New Primary Account Using Existing Structure
051191 -
051192 - Follow up ref SDS 18 4022, ref SDS 15 4022.
051193 -
051194 -  ..
051195 - Line 70, ref OF 2 GO8I, -label start
051196 -
051197 -     Changed the code today, so that we use nested processing to save
051198 -     memory.  This will capture the account structure and convert to a
051199 -     directory string, then create a list of directories and files that
051200 -     contain the list of subjects for the template account.
051201 -
051202 -  ..
051203 - Line 480, ref OF 2 H17N, -label 2ndSt
051204 -
051205 -     Start 2nd session that processes the list of directories and files
051206 -     by converting them to exist under the new project account, and
051207 -     change the internal strings to conform to the new project
051208 -     identification created by the user.
051209 -
051210 -     This session requires opening each file, which consumes memory,
051211 -     so hopefully it will chug along enough to handle the SDS
051212 -     subjects, one of of which is about 210K.
051213 -
051214 -  ..
051215 - Line 70, ref OF 2 IQ8J, -label start
051216 -
051217 -     Start by saving the index modified by the User, call the F2
051218 -     function for the index in 03501.
051219 -
051220 -     Set flag 237 882 so the code in 03501 does not return an error
051221 -     message, which prevents processing from continuing.
051222 -
051223 - Line 480, ref OF 1 TV9K, -label bH_sVx in 03501
051224 -
051225 -     This is where the code for saving a subject index is located.
051226 -
051227 - Line 540, ref OF 1 SZ5G, -label bH_sVx_q about 40 lines below in 03501
051228 -
051229 -     Flag 237 882 exits from 03501 without stopping processing.
051230 -
051231 -
051232 -  ..
051233 - Line 90, ref OF 2 OW4G, -label start about 30 lines below
051234 -
051235 -     Estabish location for template project account with macro 22, so
051236 -     we can come back.
051237 -
051238 -      ..
051239 -     Call macro macro 9 that is return to mark 2, to verify that the
051240 -     User entered mark 2 (Alt F2) to start the process; if not, stop
051241 -     and return an error message. ref OF 2 OW4G
051242 -
051243 -  ..
051244 - Line 100, ref OF 2 2X6F, -label of41
051245 -
051246 -     Verify that the template account has at least six (6) numbers,
051247 -     otherwise return an error message to select an account at the next
051248 -     level.  All of following should work...
051249 -
051250 -             02 03 04
051251 -             03 00050
051252 -             05 000006
051253 -
051254 -  ..
051255 - Line 120, ref OF 2 QT3O, -label mac19
051256 -
051257 -     Capture account string for template project.  Use char read macro
051258 -     1182, starting with 1, and stop on a dot, since all accounts end
051259 -     with a dot.
051260 -
051261 -      ..
051262 -     Return an error message if there is not a disk drive
051263 -     identification, e.g., f. ref OF 2 BS4M
051264 -
051265 -
051266 -  ..
051267 - Line 160, ref OF 2 WY7L, -label m7ok
051268 -
051269 -     Open 03505 processor and post Users ID using macro 92 that gets
051270 -     the globals and enters the account for the current user to the
051271 -     three (3) operations that will process files in the 2nd session.
051272 -
051273 -           e
051274 -           savx
051275 -           purge
051276 -
051277 -     We don't need to post the account string to these processes,
051278 -     because when we get the list of files, we will read the account
051279 -     structure from the list in order to open, save and purge each one.
051280 -
051281 -  ..
051282 - Line 180, ref OF 2 NW6G, -label m7ok about 30 lines below.
051283 -
051284 -     Enter the template account string in the change command as the
051285 -     object parameter.  This is setting up to change the project level
051286 -     portion of the account from the template account to the new
051287 -     project account in all of the subject index files that will be
051288 -     opened during the nested session.
051289 -
051290 -     Save location with macro 20, to return and append the new project
051291 -     identification.
051292 -
051293 -  ..
051294 - Line 200, ref OF 2 BE7O, -label m7ok about 70 lines below.
051295 -
051296 -     Call macro 52 to set up a processor for getting a list of files
051297 -     with subject accounts for the template project.
051298 -
051299 -     Enter the command to use dose and sf to get the list of
051300 -     directories and files for the template project account...
051301 -
051302 -                   dose/c sf h:\sd\06\
051303 -
051304 -      ..
051305 -     Append User ID using macro 92.
051306 -
051307 -      ..
051308 -     Note, today while building and testing this thing encountered
051309 -     problems getting sf.exe to run consistently, per below.
051310 -     ref SDS 0 R59M
051311 -
051312 -  ..
051313 - Line 220, ref OF 2 F43J, -label m7ok about 80 lines below.
051314 -
051315 -     Enter the directory into the dose sf command op for the account of
051316 -     the template project.  Build code process that converts the format
051317 -     of the account code in the subject index file into a disk
051318 -     directory string.
051319 -
051320 -  ..
051321 - Line 270, ref OF 2 LS5H, -label gList
051322 -
051323 -     Since we are now using nested processing, we need to set a flag in
051324 -     03505 and save it for the nested session to distinguish whether
051325 -     the process starts with a file or a directory.  If the project
051326 -     structure starts with an index file, then the first task for the
051327 -     next session is to process a file and not begin processing
051328 -     directories, as explained further below. ref SDS 0 1R4H
051329 -
051330 -  ..
051331 - Line 310, ref OF 2 OG6F, -label gList about 50 lines below.
051332 -
051333 -     This is accomplished by capturing the symbol entered for dose
051334 -     processing op into the 03505 on a comment line in 03505.  It will
051335 -     be either a $ indicating a filename or it will be blank, which
051336 -     will mean it is a directory.  The code reads the char created for
051337 -     dose sf command, and enters it into a comment line in 03505. We
051338 -     will then save 03505, so that when it is opened for the nested
051339 -     session, it will have the stuff we want.
051340 -
051341 -     Flag condition that initial string is a file.
051342 -
051343 -                         setcnt 73 893
051344 -
051345 -  ..
051346 - Line 330, ref OF 2 PK4K, -label n8cds about 20 lines below.
051347 -
051348 -     Return to the sndx subject index file, and execute macro 9, which
051349 -     is return to mark 2.  This places cursor back on the target line
051350 -     for the new project.
051351 -
051352 -     Verify that the new line has a narrative description, and if not,
051353 -     return an error message.
051354 -
051355 -  ..
051356 - Line 360, ref OF 2 CN7L, -label ulok about 20 lines below.
051357 -
051358 -     Capture account identification for the new project.
051359 -
051360 -  ..
051361 - Line 390, ref OF 2 G13J, -label ulok about 40 lines below
051362 -
051363 -     Open 30505 call macro 21 to return to the mark that places the
051364 -     change command at the top of the screen, and enter the account
051365 -     string for the new project template into the change command.
051366 -
051367 -     Calculate the string length, and use it to enter the ending
051368 -     parameter for the zone command to control the change command
051369 -     operation when the template files are opened during the nested
051370 -     session.
051371 -
051372 -  ..
051373 - Line 390, ref OF 2 X64J, -label ulok about 70 lines below.
051374 -
051375 -     Move 03505 to the line with the savx command, and enter the
051376 -     new project identification for writing the modified index files
051377 -     to the disk under the new project directory.
051378 -
051379 -     This string should be constant.  Sometimes it will start as a
051380 -     filename, when the new project account is something like...
051381 -
051382 -                         03 00050
051383 -
051384 -     ...but then all the rest of the items will directories.
051385 -
051386 -      ..
051387 -     Therefore, post the intial entry as a filename for the savx
051388 -     command....
051389 -
051390 -
051391 -                          $0300050
051392 -
051393 -
051394 -     After the first item in the index is processed, the others will
051395 -     all be directories at the project level, and so the $ is changed
051396 -     to a & in processing for the nested session....
051397 -
051398 -
051399 -                          &0300050
051400 -
051401 -
051402 -     ...if the either the first element is a directory based on a flag
051403 -     that is stored in this file, ref SDS 0 BG4L, or after the first
051404 -     element is processed as a filename, then eveything else is a
051405 -     subdirectory in the index list of the template subject for
051406 -     conversion to the new project index.
051407 -
051408 -  ..
051409 - Line 420, ref OF 2 JQ3F, -label lp2
051410 -
051411 -     Created a loop that moves across this string and collapses
051412 -     elements into a directory format that is used in the nested
051413 -     session.
051414 -
051415 -  ..
051416 - Line 470, ref OF 2 5M8N, -label ovRl2
051417 -
051418 -     Return to sndx and offset the screen using macro 23.
051419 -
051420 -     Capture 40 characters of the description for the new project, then
051421 -     switch to the processor, 03505, and store the description for use
051422 -     in the nested session for posting to the first index file for the
051423 -     new project.
051424 -
051425 -  ..
051426 - Line 510, ref OF 2 FM6J, -label ovRl2 about 70 lines below
051427 -
051428 -     Return to sndx, the subject index, and execute the dose command
051429 -     processor to build the list of directories and files for the
051430 -     template project.
051431 -
051432 -     Run another dose op for a nested session that opens the output and
051433 -     processes it with the remaining code in 03505 beginning at the #2.
051434 -
051435 -  ..
051436 - Line 540, ref OF 2 UQ5J, -label 2ndSt
051437 -
051438 -     This begins the nested session.
051439 -
051440 -     Open 03505 and capture the symbol showing whether the first line
051441 -     in the list needs to be converted into a filename.
051442 -
051443 -
051444 -  ..
051445 - Line 680, ref OF 2 NF9G, -label ffhndl
051446 -
051447 -     If the first index file is in the root directory for the user,
051448 -     then start the char read op at 1.
051449 -
051450 -  ..
051451 - Line 610, ref OF 2 U36J, -label lp1
051452 -
051453 -     The sf file list puts the filename on column 31, unless the path
051454 -     is longer that column 31.  In that case the path and filename are
051455 -     run together, so we only need a single pass of the char read
051456 -     process.
051457 -
051458 -
051459 -  ..
051460 - Line 650, ref OF 2 RP6K, -label contnu
051461 -
051462 -     Load path and filenames to e, savx, and purge commands.
051463 -
051464 -     Check savx command to recognize when a filename is the first part
051465 -     of the task, and when a path starts.
051466 -
051467 -     If macro 1181 enters a filename, then there will be a $ char, and
051468 -     in that case set flag 122 = 639
051469 -
051470 -     Use that flag to modify the savx command.
051471 -
051472 - Line 730, ref OF 2 A54I, -label jmp
051473 -
051474 -     Enter the new project description.
051475 -
051476 -
051477 -
051478 -
051479 -  ..
051480 - 03505  Alternate Scheme
051481 -
051482 - It might be possible to accomplish this task much easier.
051483 -
051484 -     Tried this and got it to work, but discovered the result does not
051485 -     solve the problem, so whole thing was abandoned.
051486 -
051487 - Instead of opening every file and saving it, we can open the first
051488 - file, change the same and save it to the new directory level.
051489 -
051490 - We can then use xcopy to copy all of the other files to below that
051491 - directory level.
051492 -
051493 -
051494 -  ..
051495 - An example would be...
051496 -
051497 -    copy h:\sd\06\00101\$0300050 h:\sd\06\00101\$0401040
051498 -
051499 - Copy all subdirectories as follows...
051500 -
051501 -    xcopy h:\sd\06\00101\&0300050\*.* h:\sd\06\00101\$0401040\ /s
051502 -
051503 - Open the new primary filename and change the name.
051504 -
051505 -      It turns out that this works, but does not accomplish the
051506 -      requirement for converting all of the files internally so that
051507 -      the account structure within each file conforms to the new
051508 -      project identification.
051509 -      ..
051510 -      As a result, used the first scheme. ref SDS 0 JKVX
051511 -
051512 -
051513 -
051514 -
051515 -
051516 -
051517 -
0516 -

SUBJECTS
SF Search File
SF Morris' File Find Program Not Working at DOS But Running in DOSE M

070401 -  ..
070402 - SF - Morris' File Find Program Seems to Be Broke
070403 -
070404 - Today, we seem to be having problems with sf.exe, which is Morris'
070405 - ffind program.
070406 -
070407 - Issues were reviewed when the code was developed, reported for example
070408 - in the record on 941011. ref SDS 16 IY4F
070409 -
070410 -     I do not seem to be able to get sf to work at the DOS prompt, but
070411 -     it runs when called within a macro using dose or dos.  Not clear
070412 -     why it does not work consistently, either fail or run.
070413 -
070414 - Today, when I enter a string like...
070415 -
070416 -     C>sf h:\sd\06\00101\&0300050\ *.*
070417 -
070418 -  ..
070419 - We are getting an error message that says...
070420 -
070421 -         NO FILES FOUND
070422 -
070423 -     '0300050\' is not recognized as an internal or external command,
070424 -     operable program or batch file.
070425 -
070426 -     c:\sd\10>
070427 -
070428 -  ..
070429 - On the other hand if the same command is called from within a macro,
070430 -
070431 -
070432 -           dose /c sf h:\sd\06\00101\&0300050\ *.* > 0w8j
070433 -
070434 -
070435 - ...per above, ref SDS 0 9W6J, we get a list of directories,
070436 - subdirectories and files placed in the file 0w8j, which is what we
070437 - need.
070438 -
070439 -  ..
070440 - Why is the thing working in a macro, but returning an error the same
070441 - thing is entered at a DOS prompt?
070442 -
070443 -
070444 -
070445 -
070446 -
070447 -
070448 -
070449 -
070450 -
070451 -
070452 -
070453 -
070454 -
070455 -
070456 -
070457 -
070458 -
070459 -
070460 -
070461 -
070462 -
070463 -
070464 -
070465 -
070466 -
070467 -