IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Single Program to handle a file of different size everytime.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Prema Suresh

New User


Joined: 12 Jun 2008
Posts: 8
Location: Bangalore

PostPosted: Wed Nov 26, 2008 10:29 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Nov 26, 2008 12:01 pm
Reply with quote

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
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Wed Nov 26, 2008 5:22 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Nov 26, 2008 6:12 pm
Reply with quote

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
View user's profile Send private message
jasorn
Warnings : 1

Active User


Joined: 12 Jul 2006
Posts: 191
Location: USA

PostPosted: Tue Mar 03, 2009 1:27 pm
Reply with quote

I think this is new enough I can post a reply without violating the protocol. This might help:
ibmmainframes.com/viewtopic.php?t=38465&start=15
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Using API Gateway from CICS program CICS 0
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top