View previous topic :: View next topic
|
Author |
Message |
ieshant koul
New User
Joined: 27 Feb 2008 Posts: 5 Location: noida
|
|
|
|
Hi!
My requirement is to create a sequential dataset from the input GDG generations (Say 25) in such a way that the output file should have both the data and blank records which would represent which generation is blank and which generation has data.
The GDG may have Data in any of the 25 generations (most of which are blank).
So i want the output file in such a way that for each blank generation, a blank line should be inserted at the corresponding position of the output file, which will tell me which generation is blank.
Regards,
Ieshant
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
I think you will need to resolve this programatically rather than using simple copy techniques. |
|
Back to top |
|
|
ieshant koul
New User
Joined: 27 Feb 2008 Posts: 5 Location: noida
|
|
|
|
hi,
thanks for replying...
initially i also tried doing it thru a cobol program. but the issue is that i am unable to select more than 40 files in a single program. And i have to process 113 fies in a similar way.
so instead of writing three programs, i thot of using some jcl utility.
Kindly also throw some light on how many files (sequential) can we use in a cobol program through JCL?
Regards,
Ieshant. |
|
Back to top |
|
|
chandu.be
New User
Joined: 17 Jul 2006 Posts: 9 Location: Bagalore
|
|
|
|
Hi,
Keep a blank line in the GDG version while creating it, if that is empty.
Then if you concatinate and copy all the versions to the output file. You will get blank lines for empty versions.
This is just suggesion..not an exact answer.
I don't think we have any utility which will give you blank line while trying to copy empty files.
Regards,
Chandu |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Why do you need to know which files are empty ?
If this wan't a concern you could just use IEBGENER or SORT to copy the whole GDG base to a new flat file in a single step. The problem is that you will need to process every single file individually to know if it contains data or not.
It could be done quite easily in REXX, but that certainly is not the best data copy vehicle in existence. |
|
Back to top |
|
|
ieshant koul
New User
Joined: 27 Feb 2008 Posts: 5 Location: noida
|
|
|
|
Hi Chandu, thanks fo rreplying.
I can't tamper the input file. so can play only with the output file.
Regards,
Ieshant |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Hold the phone and back the truck up.
The original post talks about the datasets having "both the data and blank records which would represent which generation is blank and which generation has data".
Does blank mean empty? Or does it mean that the datasets contain records composed of nothing but spaces (blanks)? |
|
Back to top |
|
|
ieshant koul
New User
Joined: 27 Feb 2008 Posts: 5 Location: noida
|
|
|
|
Yes kevin u are rite. blank means datasets contain records composed of nothing but spaces (blanks).
one more thing: the (-1) generation will always have data.
so reading from the (-24) th generation, i can always count until the last generation.
Thanks
Regards,
Ieshant..... |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
OK then. Here's what I see for options:
1. As expat already mentioned, this could be done in REXX relatively easily. However, it could be done with COBOL as well. The process would be the same:
A. Execute IDCAMS LISTCAT to create the list of all generation for the base.
B. Load the names of the datasets to a table.
C. Access the table in REVERSE order (i.e. oldest GDG first). Use dynamic allocation for the dataset. Check if it contains data or blank records. If data, write the contents to the output. If blanks, write just the single blank record. Continue the process for each generation.
2. Create a JCL procedure to use DFSORT/ICETOOL to check for the blank records on one generation dataset. If blanks are found, write only the single blank record. If not, write all the records. You would call this PROC once for each generation.
3. You could also do something similar with a single job with one step per generation, or a single jo with one step that iterates itself for each generation.
Options 2 and 3 can be built programatically based on the results of using IDCAMS LISTCAT to show all the generations for the base.
All of these options have been discussed previously within these topics. You should be able to find the necessary code for whatever option you choose. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
If you explain your requirement (this discussion about identifying "blank" generations is an attempt to solve the requirement) rather than this "solution", someone may have suggestions.
How will this new data be processed?
Quote: |
one more thing: the (-1) generation will always have data. |
Not always. When a generation is created "without data" it will become (0) when the process ends. When any new generation is cataloged, "this one" will become -1 and will not have data. . . Possibly, i am misunderstanding something.
If you explain what the goal is, we may be able to suggest some alternatives. |
|
Back to top |
|
|
ieshant koul
New User
Joined: 27 Feb 2008 Posts: 5 Location: noida
|
|
|
|
Thanks all of u for your effort.
Hey SuperK i think the second option suggested by u will help me better..
i vil try it and let u know...
just one q: how many (maximum) sequential files can we handle in a single cobol program.
Thanks a lot for putting your time and effort into it.
Regards,
Ieshant. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
ieshant koul wrote: |
how many (maximum) sequential files can we handle in a single cobol program. |
As always, check the Compiler Limits from the Appendix B in the Enterprise COBOL Language Reference. |
|
Back to top |
|
|
|