Page 1 of 2

Need Help in developing tools using Rexx

PostPosted: Thu Dec 02, 2010 10:50 pm
by Praveen433
Hi
I got recently placed in MNC as a fresher and my first task was to build some tools in Rexx. As i am completely new to this could you people help me in what are the best tools that will come as output of Rexx. As of my first task i have to write rexx code to take backup of a file by just typing "bkup" infront of the dataset, so that the backup file will be created with same as base file but 'bkup' as last qualifier. Could any one help me out in this.
Thanks in advance

Re: Need Help in developing tools using Rexx

PostPosted: Thu Dec 02, 2010 11:14 pm
by Akatsukami
If you are completely new to software tool development and/or Rexx, why did you get this assignment?

Re: Need Help in developing tools using Rexx

PostPosted: Thu Dec 02, 2010 11:30 pm
by Praveen433
It seems like there is delay in assinging projects for us. so mean while they asked us to do our best on this task. I was also trying to learn Rexx thru tutorials, but need support

Re: Need Help in developing tools using Rexx

PostPosted: Fri Dec 03, 2010 12:19 am
by enrico-sorichetti
a question here and there is ok!

but in this case You need FULL training, guidance and support,
I mildly suggest that You/Your organization are expecting too much from a forum
sharing not just general knowledge but designing something ad hoc for Your need

also the requirement is at least murky...
type something in front of a dataset ( from option 3.4 I guess )
and <do something> to take a <backup> of a dataset calling the backup datasetname.bkup

some questions that You should ask and meditate
the 3.4 list is from a catalog driven list or a volume driven one
what utility has to be used to take the backups
what are the datasets eligible ...

what ...
where ...
when ...
how ...
who
what if ...

all the questions that should be clear to the <idTENt> who gave You the assignment
who does not realize that TOOL writing is not something to be tackled lightly

how would You feel using a car built by somebody who knows nothing about cars ??? :D

Re: Need Help in developing tools using Rexx

PostPosted: Fri Dec 03, 2010 12:20 am
by Akatsukami
::sigh:: I certainly hope that MNC is not expecting to actually get a usable product out of this :roll:

OK, I think that there are already good suggestions as to Rexx textbooks and such that can be gotten by searching the fine Web; I'll handwave a basic knowledge of Rexx into existence for you. Let us look at the requirements.

You say that you will take a back-up of data set X.Y.Z, to be called X.Y.Z.BKUP, yes? What if the DSN is already more than 39 characters long?

What will the retention period of the backup be? Or, if as is common (although certainly not universal), SMS storage class controls retention, what storage class will you try to use? Or will your choices be overridden on the basis of, say, HLQ or data set size? (Hint: don't even think about asking for these answers on these or other fora; only your site support groups -- probably the storage management workgroup -- can answer these questions).

What medium are you backing up to? What utility will you use? Will the backup be foreground or background? What's the expected method of error handling; how aggressive should the tool be in handling PEBKAC errors?

These are not questions that I expect you to snap to attention and parrot answers to; I expect you contemplate the various possibilities that they open and close in your development process.

Re: Need Help in developing tools using Rexx

PostPosted: Mon Dec 06, 2010 3:34 pm
by expat
But of course, have you researched the fact that there may already be a backup mechanism in place with any installed ILM software such as HSM / FDR-ABR / Whatever

Re: Need Help in developing tools using Rexx

PostPosted: Thu Dec 30, 2010 9:58 am
by harishcv
What type of datasets are you trying to run "BKUP" macros - PS/PDS or Load libraries or VSAM???

If its PS/PDS you can try a simple program by your own
Step1: Pass dataset to ISREDIT MACRO
Step2: Allocate BackUp dataset "LIKE" original dataset - Internal logic to check bkup dataset length not to exceed 44 would be fine.
Step3: Copy data/members from original to backup - you can use LMCOPY for this.

Step4: thats it!!!!

Re: Need Help in developing tools using Rexx

PostPosted: Thu Dec 30, 2010 10:40 am
by Pedro
As Expat stated, it is best if you use the backup services already provided by the system. (I have been on the same system for 29 years)... but isn't HSM now provided as part of z/OS?

If you follow Harishcv's advice... make sure it runs the second and subsequent times.

Though, I would not use an editor macro... you have to be within the ISPF editor to use it and will not work if you want to 'take backup of a file by just typing "bkup" in front of the dataset'. Just make a regular rexx program. Also, learn how to use IEBGENER (for sequential datasets) and IEBCOPY (for PDS's) and REPRO (for VSAM). Use LISTDSI function to determine the DSORG.

Re: Need Help in developing tools using Rexx

PostPosted: Thu Dec 30, 2010 12:45 pm
by harishcv
Again that depends on your requirements. If you are looking to develop a mass backup deployment tool, then you better contact storage team and explore backup services as suggested by Expact and Pedro.

If you are looking for a simple routine for personal use, better create a macro as I said earlier.
Coding ADDRESS ISREDIT ; "MACRO"; "(DSN) = DATASET" will get you the dataset name if you type "BKUP" (macro command) in front of the dataset. You can use the dataset name extracted to do step 2 & 3 as said earlier.

The macro routines developed using rexx will work any number of times and can apply to N number of datasets together - just like we use HMIGRATE/HRECALL commands.

Re: Need Help in developing tools using Rexx

PostPosted: Sat Jan 01, 2011 1:49 am
by Pedro
Coding ADDRESS ISREDIT ; "MACRO"; "(DSN) = DATASET" will get you the dataset name if you type "BKUP" (macro command) in front of the dataset.

I do not believe that will work, as edit macros will only work while you are in the editor. I guess what I object to is the 'in front of the dataset' clause of your statement. Editor macros will not work while you are in the dataset list or in a member list.

Also:
Step2: Allocate BackUp dataset "LIKE" original dataset
will not work the same the second time. In fact, I believe it will fail, which is OK as long as you understand that and code for it.

If you reuse the same backup dataset the second time, you need to be careful of deleted members. IF the user wanted to delete them and then you need to recover the dataset from the backup, you will get the members that were intended to be deleted. ( some of you may think of that as a benefit - I do not)