View previous topic :: View next topic
|
Author |
Message |
Pravesh
New User
Joined: 30 Jul 2009 Posts: 32 Location: Gurgaon
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
Pravesh
New User
Joined: 30 Jul 2009 Posts: 32 Location: Gurgaon
|
|
|
|
Thanks for your reply
Yes, we need to hard code different LRECL in program for each input file.
Regards,
Pravesh |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Try IEBGENER. |
|
Back to top |
|
|
Binop B
Active User
Joined: 18 Jun 2009 Posts: 407 Location: Nashville, TN
|
|
|
|
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... |
|
Back to top |
|
|
Pravesh
New User
Joined: 30 Jul 2009 Posts: 32 Location: Gurgaon
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Pravesh
New User
Joined: 30 Jul 2009 Posts: 32 Location: Gurgaon
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Pravesh
New User
Joined: 30 Jul 2009 Posts: 32 Location: Gurgaon
|
|
|
|
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 |
|
|
Binop B
Active User
Joined: 18 Jun 2009 Posts: 407 Location: Nashville, TN
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Pravesh
New User
Joined: 30 Jul 2009 Posts: 32 Location: Gurgaon
|
|
|
|
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 |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
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 |
|
|
|