MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

To override the DCB inside Rexx

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
nagasadhu
Beginner


Joined: 08 Jul 2006
Posts: 17
Topics: 6

PostPosted: Wed Mar 18, 2009 9:28 am    Post subject: To override the DCB inside Rexx Reply with quote

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
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Wed Mar 18, 2009 10:10 am    Post subject: Reply with quote

well, I would do one of two things:
  • correct the incorrect jcl
  • remove the dd parms from the jcl.

_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Wed Mar 18, 2009 11:02 am    Post subject: Reply with quote

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.
_________________
New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group