Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Single Program to handle a file of different size everytime.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Single Program to handle a file of different size everytime.
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

Site Director


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

PostPosted: Wed Nov 26, 2008 12:01 pm    Post subject:
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: 743
Location: Germany

PostPosted: Wed Nov 26, 2008 5:22 pm    Post subject:
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: 7932
Location: Bellevue, IA

PostPosted: Wed Nov 26, 2008 6:12 pm    Post subject:
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

Active User


Joined: 12 Jul 2006
Posts: 153
Location: USA

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

I think this is new enough I can post a reply without violating the protocol. This might help:
http://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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 13 Tue Dec 06, 2016 8:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us