× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Scott did an outstanding job of explaining my simple question that I asked 
before finishing reading my email. 

And his program example at the end is exactly what we do in our backup 
programs.  This way we could change one line of code to change a tape 
drive (which happens about every other year here).

Rob Berendt
-- 
Group Dekko Services, LLC
Dept 01.073
PO Box 2000
Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





Scott Klement <midrange-l@xxxxxxxxxxxxxxxx> 
Sent by: midrange-l-bounces@xxxxxxxxxxxx
05/02/2005 05:50 PM
Please respond to
Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>


To
Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
cc

Subject
Re: SAVDIR not recognizing tape drive






Hello,

> You could also create a Symbolic Link to associate the path to your tape 

> dirve as TAP03 using the following command :
> ADDLNK OBJ('\qsys.lib\tap03.devd') NEWLNK(tap03)

Before doing this, I suggest that you explain what it does and why it 
would or wouldn't work for them.

The way this ADDLNK command works is that it creates a symbolic link from 
the *DEVD in QSYS to your current IFS directory. If you change your 
current IFS directory (which should be expected!) this technique will once 

again require you to specify a directory name or it won't be able to find 
the device.

The current IFS directory is analogous to your current library (*CURLIB). 
It's a variable that's part of your job that you can change at will. It 
keeps track of which directory you're currently "in", just as *CURLIB 
keeps track of the library that you're currently in.

When you specify an IFS pathname that does NOT begin with a slash (/) 
character, the system automatically appends the current directory to the 
start of it.

For example, let's say I have a file called daily_cash.csv and it's 
located in the /klements/accounting/receivables directory of the IFS. 
Maybe I want to edit that file to make a quick change.

I could type the following command to edit it:
    EDTF '/klements/accounting/receivables/daily_cash.csv'

But, if I have to do that for many files, my fingers will get tired. So, 
as a shortcut, I can change my current directory:
    CHDIR '/klements/accounting/receviables'

And then I can simply specify the filename:
    EDTF 'daily_cash.csv'

And if there are 10 other files in that directory, I can type them the 
same way, since /klements/accounting/receivables is now my current 
directory.

And that's how the ADDLNK trick works as well.  You create a symbolic link 

from /QSYS.LIB/TAP03.DEVD to the TAP03 file in your current IFS directory. 

That means that as long as your current directory does not change, you'll 
be able to reference the tape device by specifying
      SAV ... DEV(TAP03)

The tricky part is... not everyone starts with the same current directory. 

By default on the iSeries, people will start with their home directory as 
their current directory. (usually /home/your-userid -- in my case, 
/home/klemscot ).  If their home directory doesn't exist, the iSeries will 

default back to the root directory (which is just "/")

Since those users can use the CHDIR command (or the longer CHGCURDIR) to 
change their current directory at any time (just like they can use 
CHGCURLIB or CHGLIBL to change their current library) the ADDLNK technique 

will fail as soon as someone has a different value for their current IFS 
directory.

What you might want to do to keep things simple is create a "/tape" 
directory to store the symlinks in.  For example:

     MKDIR '/tape'
     ADDLNK OBJ('/qsys.lib/tap03.devd') NEWLNK('/tape/tap03')

That way, if someone wants to do a "simple" backup, they could do:

     CHDIR '/tape'
     SAV .... DEV(tap03)

Or, if they didn't want to change their current directory, they could 
still do:

     SAV .... DEV('/tape/tap03')

Which is relatively easy to remember, instead of making the user remember 
their initial directory and making all sorts of symlinks in every users 
initial directory.

Another thought.... if all you're after is a way to specify the device 
name using the same name as the one you hand off to SAVLIB and SAVOBJ, you 

might consider simply making a wrapper for the SAV command instead of 
mucking around with symbolic links.

Here's a really simple example to give you the idea:

PGM PARM(&OBJ &DEV)
     DCL VAR(&OBJ) TYPE(*CHAR) LEN(500)
     DCL VAR(&DEV) TYPE(*CHAR) LEN(10)
     DCL VAR(&DEVPATH) TYPE(*CHAR) LEN(47)
     CHGVAR VAR(&DEVPATH) VALUE('/QSYS.LIB/' *CAT &DEV *TCAT '.DEVD')
     SAV OBJ(&OBJ) DEV(&DEV)
ENDPGM

Good luck

-- 
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing 
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.