File allocation and write so many times



IBM's Command List programming language & Restructured Extended Executor

File allocation and write so many times

Postby atodpquery » Sun Jan 11, 2009 7:26 am

I have a few query about file allocation :!:

when do you DDNAME or FILE when you allocate a dataset?
Is here any different between DA and DSN?
When you FREE a file does it same as you do an IEFB14 to delete the file?
When do you use OLD SHR and REUSE?

I have a REXX program that I created an output file and the next time I execute it then I am unable to write to the file again.

Error informing file is not allocating as duplicate file name found.

When it comes to the step to write and it will said file is not found.

In this situation, should I allocate the file with OLD REUSE or SHR REUSE

My code:

if sysdsn(REPORT) is ok then ....
else
physical allocate the file


"free FI(REPORT)"
"allocate FI(REPORT) DA('myid.XXX.report') SHR REUSE"
"execio * diskw REPORT(STEM line."
if rc = 0 then
"execio 0 diskw REPORT(FINIS'
atodpquery
 
Posts: 31
Joined: Sat Nov 15, 2008 3:40 pm
Has thanked: 0 time
Been thanked: 0 time

Re: File allocation and write so many times

Postby atodpquery » Mon Jan 12, 2009 10:16 am

I have been able to do it now after delete the file every time before I write. Any other suggestions or better solutions :!:

userfile= "'"|| userid() || "." || "textscan.out'"
"FREE FILE(OUTREPT)"
Address TSO "DELETE" userfile
if rc \= 0 then
call handle_error_msg "Unable to delete to out report file"

"ALLOCATE FILE(OUTREPT) Da("userfile")",
"SPACE(1 3) CYL LRECL(80) BLOCK(25600) RECFM(F B)"

"execio * diskw OUTREPT (STEM vlt. FINIS"
if rc \= 0 then
call handle_error_msg "Unable to write to OUT REPORT"
atodpquery
 
Posts: 31
Joined: Sat Nov 15, 2008 3:40 pm
Has thanked: 0 time
Been thanked: 0 time

Re: File allocation and write so many times

Postby expat » Wed Jan 14, 2009 5:24 pm

DISP=OLD ?

"ALLOC FI(abc) DA('whatever') OLD"
expat
 
Posts: 459
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 8 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post