To override the DCB inside Rexx
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> TSO and ISPF

#1: To override the DCB inside Rexx Author: nagasadhu PostPosted: Wed Mar 18, 2009 9:28 am
    —
I read an input file and write to an output file using a rexx.
The files are allocated in the JCL but DCBs are not specified / wrongly specified.

The record length of the output file needs to be calculated in the program based on the lrecl of the input file and a few other parms.

How can I override the lrecl and the recfm of the output file in the program even if it is wrongly specified in the JCL?

(Like the DB2 unload program and dfsort).

Alter control blocks...?? dynamic alloc...??

Any pointers much appreciated. I did try searching on reasonable keywords.

PS - I worked around it by checking for the lrecl, recfm of the input file and delete - reallocate the output file. But curious if there is an alternate way to do it.

I intially tried

[code:1:32b2f02f4a]if op1mt_lrecl

#2:  Author: dbzTHEdinosauerLocation: germany PostPosted: Wed Mar 18, 2009 10:10 am
    —
well, I would do one of two things:
  • correct the incorrect jcl
  • remove the dd parms from the jcl.

#3:  Author: semigeezerLocation: Atlantis PostPosted: Wed Mar 18, 2009 11:02 am
    —
Warning - rambling post:

What you have is the way to do it. You may not need to delete the data set and reallocate it fresh, but just specify the lrecl and recfm. also, remove the spaces between the keywords and opening parentheses. you may get errors with the spaces there.

The only problem with this approach is that if the file was allocated DISP=OLD in the JCL and you reallocate it, the allocation will be freed and if another job is waiting on the data set, that job may get control before you have a chance to reallocate the data set and your program will fail. If that is a possibility, then as Dick said, insuring that the original JCL is right is the way to go although technically, if you aren't deleting the file, you could temporarily allocate the data set to another ddname to hold the ENQ as long as you don't open that other ddname. Which raises another possibility -- just use a different ddname - I think that would work too.



MVSFORUMS.com -> TSO and ISPF


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group