I'm wondering if anyone out there has a technique for handling the following
file allocation task in one step:
If the file exists, I want to allocate as OLD, i.e. I want to write over any
existing content. If the file doesn't exist, I want to allocate as NEW.
I currently do it this way:
msgstat = MSG('off')
"DELETE ('"BTS_session"')"
msgrset = MSG(msgstat)
"ALLOC F(BTSOUT) DA('"BTS_Session"') NEW ,
UNIT(SYSDA) TRACKS SP(60,50) ,
BUFNO(15) LRECL(133) ,
RECFM(F B A) DSORG(PS)"
Is there some way I can drop the DELETE?
Thanks,
George
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX
>I currently do it this way:
>
>msgstat = MSG('off')
>"DELETE ('"BTS_session"')"
>msgrset = MSG(msgstat)
>
>"ALLOC F(BTSOUT) DA('"BTS_Session"') NEW ,
> UNIT(SYSDA) TRACKS SP(60,50) ,
> BUFNO(15) LRECL(133) ,
> RECFM(F B A) DSORG(PS)"
>
>Is there some way I can drop the DELETE?
fb133.0 = "NEW CATALOG UNIT(SYSDA) SPACE(60 50) TRACKS",
"RECFM(F B A) LRECL(133) BLKSIZE(0)"
fb133.1 = "SHR" /* if it already exists... */
tempstat = Sysdsn(outdsn) = "OK" /* 1=exists, 0=missing */
"ALLOC FI(BTSOUT) DA("outdsn") REU" fb133.tempstat
> tempstat = Sysdsn(outdsn) = "OK" /* 1=exists, 0=missing */
In some cases testing to see if: sysdsn(dsn) equals "OK" is a bad idea,
because sysdsn() can return a bunch of other values admittedly in
strange circumstances. I think for example there's a no-access to
dataset message. It's sometimes safer to test for sysdsn() not being
equal to "DATASET NOT FOUND".
--
Jeremy C B Nicoll - my opinions are my own.
>In article <kv3ievsomufoijn15...@4ax.com>,
> Frank Clarke <ni...@MINDSPRING.COM> wrote:
>
>> tempstat = Sysdsn(outdsn) = "OK" /* 1=exists, 0=missing */
>
>In some cases testing to see if: sysdsn(dsn) equals "OK" is a bad idea,
>because sysdsn() can return a bunch of other values admittedly in
>strange circumstances. I think for example there's a no-access to
>dataset message. It's sometimes safer to test for sysdsn() not being
>equal to "DATASET NOT FOUND".
Won't there be unpleasant results regardless? If the response is "NO
ACCESS", I'll try to allocate it NEW, you'll try to allocate it SHR.
Neither will succeed.
Which reminds me... Don, Chris, JD... the bet's off.
> >In article <kv3ievsomufoijn15...@4ax.com>,
> > Frank Clarke <ni...@MINDSPRING.COM> wrote:
> >
> >> tempstat = Sysdsn(outdsn) = "OK" /* 1=exists, 0=missing */
> >
> >In some cases testing to see if: sysdsn(dsn) equals "OK" is a bad
> >idea, because sysdsn() can return a bunch of other values admittedly
> >in strange circumstances. I think for example there's a no-access
> >to dataset message. It's sometimes safer to test for sysdsn() not
> >being equal to "DATASET NOT FOUND".
> Won't there be unpleasant results regardless? If the response is "NO
> ACCESS", I'll try to allocate it NEW, you'll try to allocate it SHR.
> Neither will succeed.
Yes in this case, but code that checks whether a dataset (or member of
a dataset) exists doesn't always then do something that will run under
that userid - it might a generate a batch job, or set someting up to be
run by some other id. And, getting an access-denied message when you
expect just "OK" or "MEMBER NOT FOUND" and only testing for one
possible message is potentially dangerous. I only know this because
I've had code fail as a consequence. Most people use sysdsn() as if it
will *always* tell them that the dataset does or does not exist, or
that a member does or does not exist in a pds, and unfortunately the
routine can essentially return "maybe" answers too - that's all I'm
saying.
That way, if it doesn't exist, MOD will create it. If it does exist, MOD
will have no effect. And on the second allocation SHR will put the file
pointer to the beginning of file for output.
Best Regards,
Gary
-----Original Message-----
From: Mosley, George [mailto:George...@ICBC.COM]
Sent: Thursday, June 12, 2003 5:27 PM
To: TSO-...@VM.MARIST.EDU
Subject: ALLOC Technique
Hello List.
I'm wondering if anyone out there has a technique for handling the following
file allocation task in one step:
If the file exists, I want to allocate as OLD, i.e. I want to write over any
existing content. If the file doesn't exist, I want to allocate as NEW.
I currently do it this way:
msgstat = MSG('off')
"DELETE ('"BTS_session"')"
msgrset = MSG(msgstat)
"ALLOC F(BTSOUT) DA('"BTS_Session"') NEW ,
UNIT(SYSDA) TRACKS SP(60,50) ,
BUFNO(15) LRECL(133) ,
RECFM(F B A) DSORG(PS)"
Is there some way I can drop the DELETE?
Thanks,
George
George
I have found the function quite useful in production jobstreams with
conditional JCL.
The assembler code is ~ 300 lines long. If anyone is interested I can
probably post it in file520 at CBT.
George Fogg
> -----Original Message-----
> From: Ryerse, Robin [mailto:robin....@EDS.COM]
> Sent: Friday, June 13, 2003 9:42 AM
> To: TSO-...@VM.MARIST.EDU
> Subject: Re: ALLOC Technique
>
If what you have can stop me getting ACF2 violations then I'd be very
interested in getting a copy!Thanks in advance,
Dave Salt
http://www.soft-center.com
_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail
Is this the RACFACL program?
If not, how does it differ?
Bill
Dave Salt
http://www.soft-center.com
_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*
http://join.msn.com/?page=features/virus
As I discovered, you need to add a SAFDEF in order to successfully use George's rexx function in an ACF2 environment. See doc below.
Regards,
John Kalinich
CSC, St. Louis, MO
To maintain system integrity, CA-ACF2 requires that a user be
authorized to access security definitions; however, some products that
use STATUS=ACCESS are not authorized when they issue the request. The
result is that CA-ACF2 abends the task with a S047 from ACF9C000.
To accommodate these products, CA-ACF2 lets the security administrator
define the specific calls for which the authorization check for
STATUS=ACCESS will be bypassed. This is done with the NOAPFCHK
keyword on a SAFDEF record that describes the specific environment
from which this call is made. For example:
INSERT SAFDEF.apf PROGRAM(pgmname) RB(pgmname) NOAPFCHK
RACROUTE(REQUEST=AUTH,CLASS=DATASET,STATUS=ACCESS)
Dave Salt
http://www.soft-center.com
_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail
There's a way you can define a rule that obviates this
requirement for a specific program call but that's maybe
more difficult than you were hoping (and I can't remember
what it is anyway <g>) ACF2 isn't something I dabble in...
Chris
> -----Original Message-----
> From: Fogg, George
> You shouldn't see violation messages because the function is
> basically a
> query on what access level you have, not for example, like trying to
> open a dataset for update and you only have read or none.
George Fogg
> -----Original Message-----
> From: Craddock, Chris [mailto:Chris_C...@BMC.COM]
> Sent: Monday, June 16, 2003 6:43 AM
> To: TSO-...@VM.MARIST.EDU
> Subject: Re: ALLOC Technique
>