TIP: Click on subject to list as thread! ANSI
echo: os2user-l
to: All
from: Herbert Rosenau
date: 2005-04-03 12:40:36
subject: Re: REXX - Light My String ?

Don{ald} O. Woodall schrieb:

>>And then you use a lot of complicated cmd commands to produce some
>>intermediate files, read and write them multiple times and hacking
>>around.
> 
> 
>>That is more complicatet as neccessary.
> 
> 
>      I am doing what I understand and can figure how to write the code to
> do.  I am sorry I do not possess your depth of
> understanding.

So far so good. But what hinders you to learn REXX on already existend 
procedures?

Get it on your editor and print it out. Then get
1. a block of white paper
2. a pencil
3. your computer running
    optionally type 'dir /f /s >lpt'
    to get the complete directory list of the drive on paper like
    the procedure will show you
4. the REXX handbook (you can printout it when you use newview.exe
    or the builtin view.exe in eCS 1.1 or 1.2)
    You may even go into the next book shop and buy a boo that
    has "REXX" and "OS/2" in its title or on the cover.
    But with newview (look at hobbes for the most current version)
    you would it have much easier to search on keywords.
5. brain 1.0 as each mental healty human owns after he had absolved 
the first 4 classes of the elementary school and willing to learn REXX.

Now start reading the procedure and do on paper manually what it does. 
When you dos not understund a single statement look int the REXX 
handbook for that statement.

Then you will do the same I tried years ago as I was a bloody REXX 
beginner and willing to learn REXX.

A bit more comfortable for me was to insert this line in it after the 
top comment in the rexx procedure:
trace ?I
and run the script step by step.
type 'help rexx trace' in a command window and you'll get the online 
handbook opened with showing the page that tells about trace.

While the procedure holds you can type any command in it. Most 
commonly you would simply type 'say 'following by the name of the 
variable you interested on its value. So you gets shown what the 
procedure does. Even as trace is designed to debug a procedure it has 
the nice effect of presenting you what each statement does. So you can 
easy learn to understund what is going on.

It is no disgrace learning something from already existent REXX 
scripts by stuty or simply trace it.

It will help you to learn REXX more easy as sitting in fromt of a 
haystack of commands and functions you knows nothing about as that 
what the documentation will betry.


>      Also, to help you get a feel for the level of my mental
> capabilities, when I taught myself how to use LVM, I was able to figure
> out how to create "Volumes" via the 2 step process:
>      1. Create a partition
>      2. "Volumize" the partition.
> After that I was exhausted and was not willing and or able to spend the
> time and/or effort to learn how to create a Volume all in one step.

Oh, that is easy. You would only avoid seeing the physical view - but 
on other hand when you creates partitons you have a bit more control 
over the type of the partiton you needs. LVM will create either a 
primary or a logical partiton under cover qwhen you creates a volume 
from empty space. When you creats the partion from hand you can define 
the type exactly.

> 
>>If you have to do that very often you can automate this too by writing
>>a program that uses the LVM dll.
> 
> 
>      "There you go again."   You are attributing
your capabilities to
> me.	You shouldn't be doing that.

It's not a requirement it's an option. Myself tries to avoid that 
option too - but it is possible.

> 
>>But most ofen you would do that manually like you do the low
>>level things.
> 
> 
>      Affirmative.
> 
> 
>>You may even easy use LVM on commandline in a simple cmd batch to
> 
> 
>      No way, Jose!  I would not dream of attempting to
> automate the use of LVM.  I don't understand it and or the process to even
> attempt the automation.

I've mentioned that option only to give you a hint how to automate 
things more. For that I had inserted some comments I would avoid on 
the simplycity for a bit experienced programmers.

> 
>>partitonining (and LVMing the physical drive AND formatting the
>>partitons/volumes.
> 
> 
> 
>>>    4. Create / Install an UPPER CASE directory tree.
> 
> 
>>This step is superflous as this can be done while copying the data using
>>REXX
> 
> 
>      Maybe for you it is.  For me it is what and how this is all about.	I
> am not ready to try to use REXX to perform the XCOPY function yet.  Please
> let me grow at my own pace.

For that I had writte that little prozedure. You should learn easy to 
understund it using one or both of the techniques I telled above.


>      I forgot:
> 
>        6.  XCOMP X: Y:

You can extend that procedure even to do exactly that. The procedure 
is written to show the basics, not to do real work without getting 
extended by real work to do.


>>>MOVING ON
>>>---------
>>>
>>>	The above is my non-negotiable totally unreasonable procedure.
> 
> 
>>To maske things so simple as possible the only you have to do in a rexx
>>procedure is to use REXX instead of commandline commands wherever
>>possible.
> 
> 
>      Ok, I think I am finally starting to hear the bell you are ringing. 
> Also, I just spent some time reading my REXX books.

O.k., now spend time to read and understund what the procedure does 
without any change on it. As it currently does nothing as to walk 
through a number of directory trees you would learn a lot on it. 
Thereafter you will be able to extend it step by step with anything 
you has to do. As sayed prior it is written to be understundable by a 
beginner and not optimised extremely an true expert would do it.


> 
>      Yes, I understood that.  That is why I was willing to do the XCOPY
> thing.  It would not change the case of the directory names which were
> already created in uppercase to match whatever case they were on the
> source drive.

For that I'd inserted the 2 lines needed to give all pathes and file 
on the target upper case names. Change on one place upper to lower to 
give all files (not the pathes) lower case names, easy, eh?


>>O.k., you have to do that. In repeat:
>>- low level things are done manually inside the adapter BIOS - high level
>>things are:
>>  - partitoning/LVMing can be done by commandline commands
> 
> 
> 	I am not ready to try this yet.

Not true! Try to learn on that what is already given to you. You 
should able to understund what you sees step by step.

> 
>>  - formatting can be done by commandline commands
> 
> 
> 	I am not ready to try this yet.

Uh? You are really disabled to understund what
'format 'drive.k' /V:'label.k' /FS:'parttype.k' /L'
does in REXX? Seems implausible to me.

> 
>>  - replication a whole drive can be done by the rexx
> 
> 
> 	I am not ready to try this yet.

Implasible as you owns yet a REXX procedure that shows nearly that, 
even as it needs 2 new instructions to do it and that was mentioned 
multiple times now. I leave that job on you as training.

> 
>>    command file I gave you in my last artikle, extended
>>    by the functions I sent you the artikle before. You can combine
>>    both in one single REXX script.
>>  - handling more than one single drive for copying is needed!
> 
> 
> 	I do not want to do more than one drive at a time.
> I am trying to stay within my capacities and comfort zone.

O.k., then you can simply remove one do loop. But why not modify the 
number of drives to handle and change the drive letters  to your need 
as you gets that ability for free?

> 
>>    except you says that a physical disk is used for a
>>    single partiton/volume only.
>>When your system drive should not be C: primary you would use /lvm
>>commandline to create BM on the target drive too.
> 
> 
>      With this suggestion, you are way beyond the situation.
> 
>      I am just a dumb end user.  I am not a computer technician in a
> production environment trying to shove as many complete computers out the
> sales door in a day as possible.

So startup learning. It is more easy to understund an already existent 
job and extend it as to start from scratch. Why would you not go the 
way some thousend others, including myself, have done already? Learn 
by study already existent procedures. Modify them to match your 
requirements. This is done dayly even by very experienced programmers.

You HAVE the need to automate something. More you will have to 
automate something else. Startup to learn REXX and your live will be 
easier. You have sayed you have the time to learn - use it to do it.

> 
>>>	Right now I am growing from just doing DATA drive with my procedure
>>>to being able to do bootable operating system drives.
> 
> 
>>Oh, the procedure you got will be able to copy all and any data in all
>>and any drives from one physical disk to another solong there are
> 
> 
>      Right now I want to limit things to one logical drive at a time.  I
> don't feel mentally capable of more than that.

What is so complicarted on a single do loop that hinders you to 
understund it? You owns an functional brain, or not? You have a 
functional sample in front of your nose, look right.

>     
> 
>>I don't know - but you are seems unable to understand a bit REXX.
> 
> 
>      That is true.  What you sent me was over my head and not readily
> understandable by me.

So I give you some hints to learn. Start up above again.

> 
>>Read the information you have on your system about REXX.
>>There is nothing that is not documented well in the only handbook
>>"The Procedure  Language OS/2 REXX already installed with the base
>>install of your system.
> 
> 
>      I have trouble comprehending detailed info like that on a computer
> screen.  I need it printed on paper so I can page back and forth and get
> it into context.  Scrolling on a computer screen totally destroys all
> context.

There is nothing that hinders you to print that out and readf it on 
paper. I've learned more than 15 years ago how the computer can help 
me to find specific information better than paper of any kind can 
serve me. Since I replaced the view.exe WARP4 comes with with newview 
(HOBBES) it is much easier to follow information forwards and 
backwards, making notes to chapters, searching for headwords (not only 
in a single document) while reading .inf or .help files on screen as 
on paper. True, it needa a bit training to do so.

> 


> 
>>So left out of the parse.... and the names will NOT converted.
> 
> 
>      And that is why I have left file name manipulation totally out of my
> programs.

But you struggles yourself extensively by using commanline commands 
while REXX makes lots of things much easyer. Avoid the hassle with 
spaces in filenames - simply use REXX right. Avoid hassle with 
directory structures - simply use REXX right. Avoid hassle with 
lower/upper/mixed case - simply use REXX right.........

Make things so easy as possible - use REXX instead of native cmd.exe. 
You have now a lot of different command files - instead of a single 
short REXX procedure that gives you time to go for a  can of coffee or 
tee while the computer does things alone while avoiding intermitate 
files you generates only to generate other interminate files to........
> 
> 
>>I had tried to give you some basics. It is on you to understund that.
>>You'll see that using plain REXX instead of mixing up it with cmd
>>functions makes many things much simpler and easier.
> 
> 
>      They may be basic to you.	To me they are advanced.

May be - but you owns now lots of tricks to make things  very simple 
instead of lots of roudabout ways failing about problems you would 
never seen with REXX where you tries to find solutions you have 
already gotten yet.

> 
>>At least you sees that you have really no need to create intermediate
>>files and working on them multiple times.
> 
> 
>      Umm, here we disagree again.

No, really not - when you tries to use your brain and willing to 
learn. You have really absolutely no need for anything below. It is 
absolutely superlous because all that is done already in the procedure 
you avoids to get notice on.


> OS/2  Ctrl+Esc = Window List  Type HELP = help 21:55:06 Sat  4-02-2005
> 
> [H:\APPS\DIR-TREES\MAKETREE\DRIVE-F]dir
> 
> The volume label in drive H is APPS & DATA.
> The Volume Serial Number is CCFA:E914.
> Directory of H:\APPS\DIR-TREES\MAKETREE\DRIVE-F
> 
>  4-02-05  4:35a       117,467	   0 a---  drive-f-dir-lst-quc
> 
>  4-02-05  4:37a 	  636	  29 a---  drive-f-dir-lst-qucl0.cmd
>  4-02-05  4:36a 	4,240	   0 a---  drive-f-dir-lst-qucl1.cmd
>  4-02-05  4:36a 	7,377	   0 a---  drive-f-dir-lst-qucl2.cmd
>  4-02-05  4:36a 	4,600	   0 a---  drive-f-dir-lst-qucl3.cmd
>  4-02-05  4:36a        10,208	   0 a---  drive-f-dir-lst-qucl4.cmd
>  4-02-05  4:36a        22,699	   0 a---  drive-f-dir-lst-qucl5.cmd
>  4-02-05  4:36a        22,913	   0 a---  drive-f-dir-lst-qucl6.cmd
>  4-02-05  4:36a        22,926	   0 a---  drive-f-dir-lst-qucl7.cmd
>  4-02-05  4:36a        19,462	   0 a---  drive-f-dir-lst-qucl8.cmd
>  4-02-05  4:36a 	5,292	   0 a---  drive-f-dir-lst-qucl9.cmd
> 
> [H:\APPS\DIR-TREES\MAKETREE\DRIVE-F]
> 
>      You have not addressed the problem I have with:
> 
>  4-02-05  4:35a       117,467	   0 a---  drive-f-dir-lst-quc
> 
> It is a list of 1,846 directories to make.

There is no need for. The procedure does that on the fly.

>      The reason it is not a REXX program is because things would blow up
> before it completes making all 1,846 directories.

False absolutely false. Again:
The REXX procedure will
- serve you all files in a single directory
   - give you the possiblility to handle each file in that directory
     exactly on your needs (including the possibility to copy it
     to another drive by renaming it to all lower case.
     Only onle line REXX is missing for that.
- serve you all directories in that directory including
   - a list of all files in each directory included in that
     directory and its subdirectories - one directory at a time
   - a list of all directories in an specific directory including
     a list........
   - the possibility to do anything (including the possibility of
     creating it on another drive and copying anything in it from
     the old location to the new one while uppewr/lowercase any
     name recursesive - even as it contains nothing about this.
     But to get that done only one REXX statement is missing as
     to do for you.
The places are marked as comment already. You can simply place another 
do loops on the right places to NOT handle specific pathes and 
subpathes when you likes it.

You may insert some other work you may have to do with a (specific 
file or directory. You'll get each and any file and directory on a 
single drive in hand to do with it what ever you likes to do with it. 
So you have all and anything you needs - except of the detailed doing 
on each name you finds on a drive - regardless if it is holding the 
system, data or applications.

You would only have to learn REXX to understund what it does. As sayed 
prior it is much easier than to learn all the commands and its 
parameters a native .cmd can hold but absolutely more flexible than that.

Start up with learning to understund existent REXX procedures as this 
helps significantly by writing them. It is not too hard for 9 or 10 
years old childs - so it will not too hard for you.

>      That is why I had to write the program
"sortdirlevel.cmd" and break
> up the listing of directories by level of nesting. So they would run
> without crashing.

No, it is only because you had not started to learn REXX yet. It's 
time to do so now to avoid lots of problems you can't find a solution yet.


-- 
Tschau/Bye

Herbert Rosenau                    eCS 1.2 Deutsch bestellen bei
EDV Beratung & Programmierung           http://pc-rosenau.de
Eichelsdorfer Str. 15                   http://ecomstation.de
97461 Hofheim i.UFr.

Tel: 49-9523-502834
Fax: 49-9523-502823                     http://www.dv-rosenau.de/


 
Yahoo! Groups Links

 To visit your group on the web, go to:
    http://groups.yahoo.com/group/os2user/

 To unsubscribe from this group, send an email to:
    os2user-unsubscribe{at}yahoogroups.com

 Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 




---
* Origin: Waldo's Place USA Internet Gateway (1:3634/1000)
SEEN-BY: 633/267 270 5030/786
@PATH: 3634/1000 12 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.