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
 

 

COBOl program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Pravesh

New User


Joined: 30 Jul 2009
Posts: 32
Location: Gurgaon

PostPosted: Thu Nov 26, 2009 1:11 pm    Post subject: COBOl program
Reply with quote

Hi,
I have one COBOL program where I have only one input and one output file. I want to use the same program for 25 input files but all are having different LRECL. All files are huge so I want to execute this program with one file at a time. I can have different loads for each file but I am looking if the same progam can be used for all files having different logical record lenght. If yes than how ?


Regards,
Pravesh
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Nov 26, 2009 1:24 pm    Post subject:
Reply with quote

1) Probably not. Not sure about this as I am not a COBOLer, but do you not have to specify the record length in the program.

2) Consider - Are all of the record fields required for the program to execute sucessfully in the same format and same position for every different file that you wish to process with the same program.
Back to top
View user's profile Send private message
Pravesh

New User


Joined: 30 Jul 2009
Posts: 32
Location: Gurgaon

PostPosted: Thu Nov 26, 2009 1:36 pm    Post subject:
Reply with quote

Thanks for your reply
Yes, we need to hard code different LRECL in program for each input file.


Regards,
Pravesh
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Thu Nov 26, 2009 1:39 pm    Post subject:
Reply with quote

Try IEBGENER.
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Thu Nov 26, 2009 2:35 pm    Post subject:
Reply with quote

Hi Pravesh,

Elaborating on what expat has already posted...

You will have to specify us with the details on the record layout of the files. Since you say there are all having different LRECL then most probably your processing logic should also be different for each file. In such a case, personally, i dont think its such a good idea to just have one program to process all files.

Now say, all your record layout is different but the processing logic is same for all these files. Then probably you could have different programs for each files but have a subroutine call within these programs to do the "common" processing logic...

As already posted... as of now we can only make assumptions until you could give us more details... icon_wink.gif
Back to top
View user's profile Send private message
Pravesh

New User


Joined: 30 Jul 2009
Posts: 32
Location: Gurgaon

PostPosted: Thu Nov 26, 2009 4:38 pm    Post subject:
Reply with quote

Hi Binop,
Thanks for your post. FYI I have same processing logic for each file. Please have few more details:-

I have 25 files and all have different LRECL. for e.g.

File A LRECL=1000
File B LRECL=100
.
.
.
.
at a time I want to process one file only because of huge records.
How can I process each file having different LRECL in a single program?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7905
Location: Bellevue, IA

PostPosted: Thu Nov 26, 2009 4:46 pm    Post subject:
Reply with quote

If the processing logic is merely doing something to the data in the record, you can write a common subroutine and create 25 main programs, one for each file, that call the subroutine.

If the processing logic depends upon the file record length, then you probably have to write 25 programs. Write the first one, get it running correctly, then copy it 24 times and change the record length in the code. Properly set up, this is maybe half an hour of changes. Compile the programs and run them.
Back to top
View user's profile Send private message
Pravesh

New User


Joined: 30 Jul 2009
Posts: 32
Location: Gurgaon

PostPosted: Thu Nov 26, 2009 5:27 pm    Post subject:
Reply with quote

Thanks Robert
I am agree with your point that we can have 25 programs which is the last option but I a looking to have only one program which will be able to handle each file. As I told logic is same for all files just for to change in LRECL why I should have other 24 programs. Is it possible to have only one program which can handle diferent LRECL ?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7905
Location: Bellevue, IA

PostPosted: Thu Nov 26, 2009 5:37 pm    Post subject:
Reply with quote

There have been some posts in the past about doing similar things. Search this forum for BPXWDYN and read the associated concepts. I recall someone said once they did something like what you want, but I don't recall the details.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Thu Nov 26, 2009 5:45 pm    Post subject:
Reply with quote

If its a straight copy you want to perform IEBGENER takes the input DCB
values to the output, you have to do that 25 times or you can use a sort
utility to do a straight copy in 1 step.

I never detected in your question something about processing individual
records, so for me it looks like a straight copy.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Nov 26, 2009 5:53 pm    Post subject:
Reply with quote

Why not use SORT to cut the file to the correct length prior to the program, and then after the program to revert to the original LRECL

This does assume, as you have not said otherwise, that the record layouts are identical, and that there is no other valid data past the point of the LRECL defined in the program.
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: Thu Nov 26, 2009 11:15 pm    Post subject:
Reply with quote

Hello,

Quote:
looking to have only one program which will be able to handle each file. As I told logic is same for all files just for to change in LRECL why I should have other 24 programs. Is it possible to have only one program which can handle diferent LRECL ?
Yes, use assembler. . .

Quote:
FYI I have same processing logic for each file
If you explained what processing is to be done, someone might have a suggestion.
Back to top
View user's profile Send private message
Pravesh

New User


Joined: 30 Jul 2009
Posts: 32
Location: Gurgaon

PostPosted: Fri Nov 27, 2009 6:12 pm    Post subject:
Reply with quote

Thank you all for your suggestions.

In logic part I am calculating only no. of bytes used in particular file
No of Bytes used = total record count * LRECL
so using sort and IEBGENER are not feasible for my requirement. if anybody knows some other mathod also please suggest.

Any help would be appreciated

Regards,
Pravesh
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Fri Nov 27, 2009 10:56 pm    Post subject:
Reply with quote

Hi,

Quote:
In logic part I am calculating only no. of bytes used in particular file
No of Bytes used = total record count * LRECL
So you are expecting the total for 25 different files... or total of these 25 ... i.e. one single output ?
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: Fri Nov 27, 2009 11:28 pm    Post subject:
Reply with quote

Hello,

Quote:
so using sort and IEBGENER are not feasible for my requirement.

Suggest you run a sort and look at the informatoinal output.
Back to top
View user's profile Send private message
Pravesh

New User


Joined: 30 Jul 2009
Posts: 32
Location: Gurgaon

PostPosted: Mon Nov 30, 2009 6:12 pm    Post subject:
Reply with quote

Thank you Dick and others for suggestions
I ran my job having sort card and came to know regarding no if bytes used as you told and I copied sysout in a file also but I want to write only count,sydate and no of bytes in output file. I can do it thru Easytrieve program but thing is that I do not know how to use reference modification in Easytrive. If any body have any other suggestion please let me know.


Regards,
Pravesh
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Mon Nov 30, 2009 7:34 pm    Post subject:
Reply with quote

If you have Easytrev installed, there will be a manual somewhere
where the MOVE statement is explained :

MOVE x MCTR TO y MCTR

where MCTR is the lenght to move, in this case the same length

MOVE X'00' 1 TO y 48 FILL X'00'

where 1 byte is moved to y and the remaining 47 bytes are zeroed.
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 IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts COBOL Version 6.1 Virendra Shambharkar COBOL Programming 5 Tue Nov 01, 2016 11:24 am
No new posts Cobol list of programs being called biswajit.dattagupta COBOL Programming 5 Tue Nov 01, 2016 2:10 am


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