MVS command to Add an Exit routine to an Exit
Posted by Rui Miguel Feio in MVS on August 19th, 2009
When you require to add an exit routine to an exit you may use the most simple form of the Add command:
/SETPROG EXIT,ADD,EXITNAME=exit_name,MODNAME=mod_name,DSNAME=dsname
Example:
exit_name = SYS.IEFACTRT
mod_name = IEFACTRT
dsname = SYS2.LINKLIB.TST1
/SETPROG EXIT,ADD,EXITNAME=SYS.IEFACTRT,MODNAME=IEFACTRT,DSNAME=SYS2.TST1.LINKLIB
Other parameters:
When adding an Exit routine to an Exit you may also have the need to use one or more of the following parameters:
STATE=active_inactive - Indicates the state of the exit routine. ACTIVE is the default value.
JOBNAME=jobname – The job(s) name(s) for which this exit routine is to get control. If some other job calls the exit, this exit routine does not get control. The default value is * which means all the jobs.
ABENDNUM=(n[,CONSEC]) – indicates that the exit routine is not to be given control after the n abends occur. CONSEC indicates that there must be n consecutive abends before the system stops giving control to the exit routine.
FIRST – Specifies that the system is to call the exit routine before all other exit routines associated with this exit, unless another exit routine, added after it, also specifies FIRST.
LAST - Specifies that the system is to call the exit routine after all other exit routines associated with this exit, unless other exit routines are added after it.
Examples:
/SETPROG EXIT,ADD,EX=SYS.IEFU83,MOD=CYN1FU83,DSN=CYN.SCYNAUTH,FIRST
/SETPROG EXIT,ADD,EX=SYS.IEFU83,MOD=CYN1FU83,DSN=CYN.SCYNAUTH,FIRST,STATE=INACTIVE
/SETPROG EXIT,ADD,EX=SYSSTC.IEFACTRT,MOD=IEFACTRT,ABENDNUM=(5)
/SETPROG EXIT,ADD,EX=SYSSTC.IEFACTRT,MOD=IEFACTRT,ABENDNUM=(5,CONSEC)
MVS commands to display Dynamic Exits
Posted by Rui Miguel Feio in MVS on August 17th, 2009
The following are some of the most common ways to display Exits and Exit Routines:
1. Display the names of all the Exits
/D PROG,EXIT,ALL
Example of what this command returns:
CSV460I 13.31.32 PROG,EXIT DISPLAY 941
EXIT DEF EXIT DEF EXIT DEF
SYSSTC.IEFACTRT E SYSSTC.IEFUJI E SYSSTC.IEFUJV E
SYS.IEFACTRT E SYS.IEFUJI E SYS.IEFUJV E
SYS.IEFU83 E SYS.IEFU84 E SYS.IEFU85 E
SYSSTC.IEFU83 E SYSSTC.IEFU84 E SYSSTC.IEFU85 E
...
2. Display the names of all exit routines associated with the named exit
/D PROG,EXIT,EXITNAME=exit_name
Example:
exit_name = SYS.IEFACTRT
/D PROG,EXIT,EXITNAME=SYS.IEFACTRT
Returns:
RESPONSE=TST1
CSV461I 14.15.02 PROG,EXIT DISPLAY 068
EXIT MODULE STATE MODULE STATE MODULE STATE
SYS.IEFACTRT IEFACTRT A STRBACTR A
3. Display the names of the exits with which the specified exit routine is associated
/D PROG,EXIT,MODNAME=mod_name
Example:
mod_name = IEFACTRT
/D PROG,EXIT,MODNAME=IEFACTRT
Returns:
RESPONSE=TST1
CSV462I 14.20.25 PROG,EXIT DISPLAY 906
MODULE IEFACTRT
EXIT(S) SYSSTC.IEFACTRT SYS.IEFACTRT
MVS command to Delete an Exit routine from an Exit
Posted by Rui Miguel Feio in MVS on August 17th, 2009
The following command deletes an exit routine from an exit:
/SETPROG EXIT,DELETE,EXITNAME=exit_name,MODNAME=mod_name,FORCE=yes_no
Example:
exit_name = SYSSTC.IEFACTRT
mod_name = IEFACTRT
/SETPROG EXIT,DELETE,EXITNAME=SYSSTC.IEFACTRT,MODNAME=IEFACTRT
Note:
FORCE = NO is the default value and therefore we don’t need to specify it. This changes the state of the exit routine to inactive and the system does not free the storage.
FORCE=YES frees the storage of the exit routine immediately and it should be used only if you are sure that no exit is running that exit routine.
Backup and Restore a web site in CPANEL
Posted by Rui Miguel Feio in MySQL, PHP, WordPress on August 16th, 2009
It’s a good practice to make backups prior to submit any changes to your site.
Time and again people skip the backup to find themselves with problems and not having an easy and quick way to undo their changes. This may not seem a big problem, but if the changes were done to the web site of your business and now the web site is not working probably, this means you’re losing money!
Backing up a site is easy and even more if your web server uses CPANEL.
Consider the following steps to BACKUP your site:
- To Backup the files of your site:
- On CPANEL select option Backups
- Under Home Directory select option Download a home directory Backup
- Select Save File
- To Backup the Databases of your site:
- On CPANEL select option Backups
- Under Download a MySQL Database Backup select the Database you wish to Backup
- Select Save File
- Repeat Steps 2 and 3 for any other Database you wish to backup
Consider the following steps to RESTORE your site:
- To Restore the files of your site:
- On CPANEL select option Backups
- Under Restore a Home Directory Backup select Browse and locate the backup you want to restore from
- Select Upload
- To Restore the Databases of your site:
- On CPANEL select option Backups
- Under Restore a MySQL Database select Browse and locate the backup you want to restore from.
- Select Upload
- Repeat Steps 2 and 3 for any other Database you wish to restore
How to check which RACF datasets are in use
Posted by Rui Miguel Feio in RACF on August 16th, 2009
Knowing the names and locations of the RACF datasets that are currently being used by the system is quite easy.
For this we have to use the command TSO RVARY
Example:
TSO RVARY
Returns:
RACF DATABASE STATUS:
ACTIVE USE NUM VOLUME DATASET
------ --- --- ------ -------
YES PRIM 1 TSTCT1 SYS1.RACF.PRIMARY
YES BACK 1 TSTDL1 SYS1.RACF.BACKUP
RVARY COMMAND HAS FINISHED PROCESSING.
Note:
YES indicates that the dataset is active and therefore in use by the system.
TSTCT1 and TSTDL1 are the volume names where each of the RACF datasets are located.
Tip:
Issuing the command TSO RVARY is exactly the same thing as issuing the command TSO RVARY LIST.
How to check who’s allocating a device unit
Posted by Rui Miguel Feio in MVS on August 16th, 2009
Let’s say for instance that you have a DASD volume (TSTCT1) and you would like to know who’s using it (allocating it).
In order to do this we first need to know the unit address of said device:
/D U,VOL=volume_name
In our example:
/D U,VOL=TSTCT1
Result:
RESPONSE=TST1
IEE457I 09.53.10 UNIT STATUS 444
UNIT TYPE STATUS VOLSER VOLSTATE
7001 3390 A TSTCT1 PRIV/RSDNT
Note: In this case as we can see the unit address of TSTCT1 is 7001.
Once we know the unit address then we can check who’s allocating it by using the command:
/D U,,ALLOC,address,1
In our case:
/D U,,ALLOC,7001,1
Result:
RESPONSE=TST1
IEE106I 09.56.08 UNITS ALLOCATED 623
UNIT JOBNAME ASID JOBNAME ASID JOBNAME ASID JOBNAME ASID
7001 *MASTER* 0000 *MASTER* 0001 XCFAS 0006 OMVS 000E
7001 CATALOG 0023 LLA 0024 JES2 0028
Note:
We use “1″ in the end of the command so that we only get the display for the single device we’ve specified in the command.
How to move a WordPress site to a different Server or URL
Posted by Rui Miguel Feio in WordPress on August 8th, 2009
Moving a WordPress site from one server to another or to a different Web address (URL) may seem a daunting task and something to stay away from. The truth is that it is quite simple!
Last month I was asked to help moving a WordPress (WP) blog from one server to another and I thought I should share with the world how this can be done.
Performing this task requires 3 major steps:
1. Move the WordPress Source Code
2. Move the WordPress Database
3. Update the WordPress configuration
For the sake of this example I will provide the general instructions for a WordPress running on LAMP (Lunix, Apache, MySQL and PHP) environment with CPanel and I’ll assume that we want to move it from http://www.original-server.com/blog to http://www.destination-server.com/blog.
STEP 1 – Move the WordPress Source Code:
(Original server)- Download the WordPress source files:
1. On CPanel select “File Manager”
2. Tick (check) the folder that contains the WordPress blog source files (ex: blog)
3. Select “Compress” from the menu
4. Select “Compress File(s)”
5. Tick (check) the zip file you’ve just created
6. Select “Download” from the menu and save the zip file locally
7. Once the download is finished delete the zip file from the server
(Destination Server) – Upload the WordPress source code:
1. On CPanel select “File Manager”
2. Select the “Upload” option
3. Locate and select the zip file that contains the WordPress source code you’ve copied into your PC.
4. Upload your file into the new server
5. Select the zip file
6. Select “Extract” from menu
7. Delete Zip file from server
Note: Beware! When you unzip the file if a directory already exists with the same name its content will be replaced!
STEP 2 – Move the WordPress Database:
(Original Server) – Export WordPress Database:
1. On CPanel select option “phpMyAdmin” (MySQL Databases)
2. Select the WordPress Database that you want to export (ex: wp01)
2. Select “Export”
3. Make sure all the Tables are selected
4. Leave all the default options ticked
5. Make sure to download as an SQL file
6. Check “Save as File”
7. Click “Go” and save it locally
Note: In addition you may also select “zipped” or “gzipped” to compress your database when downloading it.
(Destination Server) – Create new Database:
1. On CPanel select “MySQL Databases”
2. Create a new DB for the blog (ex: wp01) and if possible with the same name as it had originally
3. Create a new user for the blog if possible with the same name as originally
4. Associate the new user with the WordPress Database you’ve just created and all privileges to it.
(Locally) – Update WordPress MySQL database:
1. Edit the WordPress SQL database you’ve downloaded from the original server.
2. If the web address URL has changed:
- replace all references of the old URL with the new URL
- note that if on the new server you’re using a different directory, this needs to change too.
3. If the email addresses have changed, replace them with the new addresses.
4. Save your changes.
(Destination server) – Upload WordPress Database:
1. On CPanel, select “phpMyAdmin” (MySQL Databases)
2. Select the WordPress Database
3. Select the “Import” option
4. Locate and select the WordPress SQL Database you have saved locally.
5. Import file
STEP 3 – Update the WordPress configuration:
(Destination Server) – Update config file:
1. On Cpanel select “File Manager”
2. Locate and edit WordPress configuration file “wp-config.php”
3. Update WP DB name with the new WordPress Database name: define(‘DB_NAME’, ‘database_name_goes_here’);
4. Update user name: define(‘DB_USER’, ‘user_name_goes_here’);
5. Update Database password: define(‘DB_PASSWORD’, ‘password_goes_here’);
6. Update hostname (if required): define(‘DB_HOST’, ‘hostname_goes_here’);
7. Save your changes
STEP 4 – Testing:
1. Simply test your blog to make sure that all the functionalities are available
How to select the First row from a MySQL table
Posted by Rui Miguel Feio in MySQL on July 6th, 2009
You can use the following command to get the first row from a MySQL table:
SELECT * FROM table LIMIT 1
Explanation:
table - table name
By limiting the returns to 1 (LIMIT 1) we get the first row from the table.
Example:
SELECT * FROM tusers LIMIT 1
How to select the Last row from a MySQL table
Posted by Rui Miguel Feio in MySQL on July 6th, 2009
You can use the following command to get the last row from a MySQL table:
SELECT * FROM table ORDER BY field DESC LIMIT 1
Explanation:
table - table name
field - table field
This command orders the table by DESCENDING order and limits the number of rows returned to 1. Since DESCENDING reverses the normal table order, we get its last row.
Example:
SELECT * FROM tusers ORDER BY user_id DESC LIMIT 1
Select random rows from a MySQL table
Posted by Rui Miguel Feio in MySQL on July 6th, 2009
If you ever come across the need of randomly select rows from a MySQL table:
SELECT * FROM table WHERE field1 = value ORDER BY RAND() LIMIT x
Explanation:
table - table name
field1 - table field
value - value you want field1 to be
x – number of rows to return
Example:
SELECT * FROM tusers WHERE active_user = ‘Yes‘ ORDER BY RAND() LIMIT 10
This command returns 10 random rows of active users from table tusers.