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 

File Allocation with different record lengths

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
Bithead
Advanced


Joined: 03 Jan 2003
Posts: 550
Topics: 23
Location: Michigan, USA

PostPosted: Tue Sep 19, 2006 1:44 pm    Post subject: File Allocation with different record lengths Reply with quote

I have written a dummy FTP program in COBOL for Disaster Recovery testing purposes. The dummy program generates basic output to indicate that the FTP worked without actually running the FTP. This allows us to run job streams at our disaster recovery test site without changing any of the steps and without accidentally FTPing data. We simply add the dummy FTP load module to a library in LINKLIST that is ahead of the CEZA library where the real FTP program resides.

The problem is that programmers can define the OUTPUT dataset as LRECL=133 or LRECL=80 and the program needs to handle this. Can anyone suggest a way of doing this?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue Sep 19, 2006 2:20 pm    Post subject: Reply with quote

Quote:

The problem is that programmers can define the OUTPUT dataset as LRECL=133 or LRECL=80 and the program needs to handle this. Can anyone suggest a way of doing this?


I did not the get the entire requirement but , something you can try

Code 2 file definitions one for 80 and another for 133. The programmer will create a parm(or you can create the parm to be read into the program based on the lrecl) and use BPXWDYN to allocate the file dynamically based on the parm. So at any time you will only allocating one file.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Bithead
Advanced


Joined: 03 Jan 2003
Posts: 550
Topics: 23
Location: Michigan, USA

PostPosted: Tue Sep 19, 2006 3:15 pm    Post subject: Reply with quote

Kolusu,

Unfortunately, I can't have a PARM because I can't change the JCL.
Back to top
View user's profile Send private message
Bithead
Advanced


Joined: 03 Jan 2003
Posts: 550
Topics: 23
Location: Michigan, USA

PostPosted: Tue Sep 19, 2006 6:35 pm    Post subject: Reply with quote

Kolusu,

I found a way to do it. I traverse the MVS control blocks to get to the JFCB then I spin thru looking for a DDNAME = OUTPUT. This will give me the LRECL for temporary datasets. I will work on a similar solution for permanent datasets.

Once I determine the record length, I can call a subroutine to write the appropriate messages.

These messages can then be interogated by subsequent steps to see if the FTP ran correctly.
Back to top
View user's profile Send private message
Bithead
Advanced


Joined: 03 Jan 2003
Posts: 550
Topics: 23
Location: Michigan, USA

PostPosted: Fri Sep 22, 2006 10:41 am    Post subject: Reply with quote

I am having a problem getting information for some datasets. If the DCB is coded in the JCL, then I can get the information from the JFCB blocks but this is zero if the dataset is permanent. I have found examples on how to get this information but the dataset needs to be opened first which I can't do because I don't know the LRECL. Can anyone suggest a solution?

My main program is written in COBOL. I cannot use REXX or other ISPF services. I cannot have the user pass parameters to the program.
Back to top
View user's profile Send private message
semigeezer
Supermod


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

PostPosted: Fri Sep 22, 2006 10:49 am    Post subject: Reply with quote

If you can drop down to assembler, you can open the file and then look at the DCB or JFCB. I don't know COBOL, so I don';t know if you can just open it in COBOL without defining the attributes beforehand, but in assembler, you can leave off all of the attributes and the DCB and/or JFCB should be filled in upon open.
Back to top
View user's profile Send private message Visit poster's website
Bithead
Advanced


Joined: 03 Jan 2003
Posts: 550
Topics: 23
Location: Michigan, USA

PostPosted: Fri Sep 22, 2006 11:11 am    Post subject: Reply with quote

You can't do this in COBOL. Do you have an example in assembler? Maybe I could call it as a sub-routine.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming 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