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

Copy gdgs to put blank records in the outfile


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ieshant koul

New User


Joined: 27 Feb 2008
Posts: 5
Location: noida

PostPosted: Wed Apr 02, 2008 11:40 am
Reply with quote

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
icon_smile.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Apr 02, 2008 11:42 am
Reply with quote

I think you will need to resolve this programatically rather than using simple copy techniques.
Back to top
View user's profile Send private message
ieshant koul

New User


Joined: 27 Feb 2008
Posts: 5
Location: noida

PostPosted: Wed Apr 02, 2008 11:50 am
Reply with quote

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

New User


Joined: 17 Jul 2006
Posts: 9
Location: Bagalore

PostPosted: Wed Apr 02, 2008 11:57 am
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Apr 02, 2008 11:59 am
Reply with quote

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

New User


Joined: 27 Feb 2008
Posts: 5
Location: noida

PostPosted: Wed Apr 02, 2008 12:06 pm
Reply with quote

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

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Apr 02, 2008 12:23 pm
Reply with quote

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

New User


Joined: 27 Feb 2008
Posts: 5
Location: noida

PostPosted: Wed Apr 02, 2008 2:53 pm
Reply with quote

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

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Apr 02, 2008 5:04 pm
Reply with quote

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

Moderator Emeritus


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

PostPosted: Wed Apr 02, 2008 9:19 pm
Reply with quote

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

New User


Joined: 27 Feb 2008
Posts: 5
Location: noida

PostPosted: Thu Apr 03, 2008 11:08 am
Reply with quote

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

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Apr 03, 2008 4:22 pm
Reply with quote

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
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts VB to VB copy - Full length reached SYNCSORT 8
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top