View previous topic :: View next topic |
Author |
Message |
Bithead Advanced

Joined: 03 Jan 2003 Posts: 550 Topics: 23 Location: Michigan, USA
|
Posted: Tue Sep 19, 2006 1:44 pm Post subject: File Allocation with different record lengths |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Tue Sep 19, 2006 2:20 pm Post subject: |
|
|
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 |
|
 |
Bithead Advanced

Joined: 03 Jan 2003 Posts: 550 Topics: 23 Location: Michigan, USA
|
Posted: Tue Sep 19, 2006 3:15 pm Post subject: |
|
|
Kolusu,
Unfortunately, I can't have a PARM because I can't change the JCL. |
|
Back to top |
|
 |
Bithead Advanced

Joined: 03 Jan 2003 Posts: 550 Topics: 23 Location: Michigan, USA
|
Posted: Tue Sep 19, 2006 6:35 pm Post subject: |
|
|
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 |
|
 |
Bithead Advanced

Joined: 03 Jan 2003 Posts: 550 Topics: 23 Location: Michigan, USA
|
Posted: Fri Sep 22, 2006 10:41 am Post subject: |
|
|
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 |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Fri Sep 22, 2006 10:49 am Post subject: |
|
|
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 |
|
 |
Bithead Advanced

Joined: 03 Jan 2003 Posts: 550 Topics: 23 Location: Michigan, USA
|
Posted: Fri Sep 22, 2006 11:11 am Post subject: |
|
|
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 |
|
 |
|
|