View previous topic :: View next topic
|
Author |
Message |
Prema Suresh
New User
Joined: 12 Jun 2008 Posts: 8 Location: Bangalore
|
|
|
|
Hi,
The requirement is as follows:
I have a program, which takes in a file in I-O mode and updates a field in the same file after referring to a DB2 table.
This program needs to be plugged into many JCLs and the file is of varying size in each JCL. For Example, JCL A has file of length 200 which will be fed to this program and JCL B has file of length 700 which will also be fed to the same program.
Can you guide me how can I make this possible with a single program plugged into these JCLs instead of having so many copies of the same program to suit different File definition? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I am very sorry. I have posted in incorrect sub topic. |
Thank you for the follow-up - i have deleted the other topic. |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
Hi Prema Suresh !
If you know all the LRECL's of these different files you have, then you know the maximum LRECL. Is it so?
Is this field in the sentence you have to update allway on the the same
position? For example let's say Record-Beginn+24Bytes in Length-9?
Further aktion depends on that. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Are the files fixed length or variable length? If the file record length is variable, and you can live with every file having the maximum record length of any file, you can use a variable length file of maximum length. However, the LRECL for every file would be 704 in your example, even the 200-byte file.
In general you need to be aware that COBOL is a compiled language. You define the file layout at compile time and use it at run time. You cannot have a generic file manipulation routine using different length files in COBOL. Period. You can have COBOL call an Assembler routine which does generic file manipulation, but COBOL itself won't do it. |
|
Back to top |
|
|
jasorn Warnings : 1 Active User
Joined: 12 Jul 2006 Posts: 191 Location: USA
|
|
Back to top |
|
|
|