6/17/08 - How to streamline the deletion of logical files when you need to delete a physical file

Deleting logical files can be a time consuming task when you need to delete a physical file due to the number of logical files that have no common prefix to the file name to wildcard.

This simple CL program could help:


PGM PARM(&SYS1OBJ &SYS1LIB)
DCL VAR(&SYS1OBJ) TYPE(*CHAR) LEN(10)
DCL VAR(&SYS1LIB) TYPE(*CHAR) LEN(10)
DCLF FILE(QADSPDBR)
OVRDBF FILE(QADSPDBR) TOFILE(QTEMP/DBRRMV)
DSPDBR FILE(&SYS1LIB/&SYS1OBJ) OUTPUT(*OUTFILE) +
OUTFILE(QTEMP/DBRRMV)
MONMSG MSGID(CPF3012) EXEC(GOTO CMDLBL(EOF))
READ: RCVF
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(DLTF))
IF COND(&WHNO *EQ 0) THEN(GOTO CMDLBL(DLTF))
DLTF FILE(&WHRELI/&WHREFI)
MONMSG MSGID(CPF0001)
GOTO CMDLBL(READ)
DLTF: DLTF FILE(&SYS1LIB/&SYS1OBJ)
MONMSG MSGID(CPF0001)
EOF: ENDPGM



Disclaimer: Vision Solutions makes every effort to provide accurate system management information and programming code; however the company cannot be held liable for the accuracy of information nor its compatibility in your own environment. Please review and test thoroughly before implementing. © Copyright 2008, Vision Solutions, Inc. All rights reserved. IBM, System i, iSeries, and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.

6/9/08 - How to send a message to multiple users

Type the command CALL QEZSNDMG.

Fill in the parameters as follows:

-Message needs reply (Y or N)
-Interrupt user (Y or N) – will send a break message when Y is specified
-Message text (up to 512 characters)
-Send to – this is a list and can also use special values of *ALL and *ALLACT
Press F10 to send the message

This will send out the message to all of the workstations that the users are signed on to at the time.



Disclaimer: Vision Solutions makes every effort to provide accurate system management information and programming code; however the company cannot be held liable for the accuracy of information nor its compatibility in your own environment. Please review and test thoroughly before implementing. © Copyright 2008, Vision Solutions, Inc. All rights reserved. IBM, System i, iSeries, and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.

6/2/08 How to end a job that won't end by itself

Occasionally jobs can get hung up causing them to not end on their own. When this happens, as a last resort, you can use the ENDJOBABN command to force the job to end.


Editor's note: An expanded discussion on this topic can be found here: 10/21/09 Know the impact of using the ENDJOBABN command


Disclaimer: Vision Solutions makes every effort to provide accurate system management information and programming code; however the company cannot be held liable for the accuracy of information nor its compatibility in your own environment. Please review and test thoroughly before implementing. © Copyright 2008, Vision Solutions, Inc. All rights reserved. IBM, System i, iSeries, and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.

5/28/08 How to find journal receivers taking the most disk space

Use the following command for an easy way to see the journal receivers that are taking up a lot of disk space on your system:

DSPOBJD *ALL/*ALL *JRNRCV

Example:


Display Object Description - Basic
Library 3 of 87
Library . . . . . . : AUDRCV Library ASP device . : *SYSBAS

Type options, press Enter.
5=Display full attributes 8=Display service attributes

Opt Object Type Size Text
_ AUDRCV1270 *JRNRCV 515153920 Qaudjrn receiver
_ AUDRCV1271 *JRNRCV 515153920 Qaudjrn receiver
_ AUDRCV1272 *JRNRCV 515153920 Qaudjrn receiver
_ AUDRCV1273 *JRNRCV 516202496 Qaudjrn receiver
_ AUDRCV1274 *JRNRCV 515153920 Qaudjrn receiver
_ AUDRCV1275 *JRNRCV 514105344 Qaudjrn receiver
_ AUDRCV1276 *JRNRCV 516202496 Qaudjrn receiver
_ AUDRCV1277 *JRNRCV 515153920 Qaudjrn receiver
_ AUDRCV1278 *JRNRCV 515153920 Qaudjrn receiver
_ AUDRCV1279 *JRNRCV 515153920 Qaudjrn receiver
_ AUDRCV1280 *JRNRCV 516202496 Qaudjrn receiver
_ AUDRCV1281 *JRNRCV 514105344 Qaudjrn receiver



The size of the receivers in the above example are .5 GB or larger. Press the Enter key to move from library to library, viewing the size of each receiver, look for receivers with a size of 10 positions which would indicate a receiver with the size of 1 GB or larger.


Disclaimer: Vision Solutions makes every effort to provide accurate system management information and programming code; however the company cannot be held liable for the accuracy of information nor its compatibility in your own environment. Please review and test thoroughly before implementing. © Copyright 2008, Vision Solutions, Inc. All rights reserved. IBM, System i, iSeries, and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners

5/21/08 Creating symbolic links on the IFS

Anybody familiar with UNIX or Linux operating systems is aware of the usefulness of symbolic links to folders and files. This basically involves creating a link to a file in another location from the original, allowing people to access or edit the original file from another location.

On the System i this can be done by prompting the ADDLNK command. Enter the full IFS path of the object you want to link to in the Object field and the full IFS path of the link you would like to create for it.


Use link type *SYMBOLIC if you need to link to an object on another file system or if you would like the link to remain regardless of whether the object you are linking to still exists, use link type *HARD if you would like to make sure links are only maintained whilst the object exists (if you choose to delete the object at a later date you would need to remove its *HARD links first).

**Editor's note: This post was updated on 07/21/08 to correct an inaccuracy pointed out in the comments posted by a reader.

Disclaimer: Vision Solutions makes every effort to provide accurate system management information and programming code; however the company cannot be held liable for the accuracy of information nor its compatibility in your own environment. Please review and test thoroughly before implementing. © Copyright 2008, Vision Solutions, Inc. All rights reserved. IBM, System i, iSeries, and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.

5/13/08 How to stop page up/page down iterations

Ever held down the ‘Page Down’ or ‘Page Up’ keys down too long and the screen wouldn’t stop advancing? The easy way to stop it is to simply press the ‘Ctrl’ key.


Disclaimer: Vision Solutions makes every effort to provide accurate system management information and programming code; however the company cannot be held liable for the accuracy of information nor its compatibility in your own environment. Please review and test thoroughly before implementing. © Copyright 2008, Vision Solutions, Inc. All rights reserved. IBM, System i, iSeries, and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.

5/5/08 Copy contents of spool file to a flat file

Step 1:
Create a flat file that has a record length of 132 (most spool files have a width of 132).

CRTPF FILE(FLATFILE) RCDLEN(132)

Step 2: Copy the spool file to the newly created flat file.

CPYSPLF FILE(QPDSPAJB) TOFILE(FLATFILE) JOB(*) SPLNBR(1)

Step 3: Copy the file to the IFS.

CPYTOSTMF FROMMBR('/qsys.lib/library.lib/flatfile.file/flatfile.mbr') TOSTMF('/somewhereintheifs/spoolfile.txt')



Disclaimer: Vision Solutions makes every effort to provide accurate system management information and programming code; however the company cannot be held liable for the accuracy of information nor its compatibility in your own environment. Please review and test thoroughly before implementing. © Copyright 2008, Vision Solutions, Inc. All rights reserved. IBM, System i, iSeries, and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.