Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Copy gdgs to put blank records in the outfile

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Copy gdgs to put blank records in the outfile
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: 8593
Location: Back in jolly old England

PostPosted: Wed Apr 02, 2008 11:42 am    Post subject:
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    Post subject: Reply to: gener gdg versions to put blank records in the out
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Apr 02, 2008 11:59 am    Post subject:
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    Post subject:
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

Moderator Team Head


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

PostPosted: Wed Apr 02, 2008 12:23 pm    Post subject: Reply to: Copy gdgs to put blank records in the outfile
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    Post subject:
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

Moderator Team Head


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

PostPosted: Wed Apr 02, 2008 5:04 pm    Post subject: Reply to: Copy gdgs to put blank records in the outfile
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

Site Director


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

PostPosted: Wed Apr 02, 2008 9:19 pm    Post subject:
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    Post subject:
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

Moderator Team Head


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

PostPosted: Thu Apr 03, 2008 4:22 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts XMITIP sends it out. Can it copy on l... Rommel Dayon Rustia IBM Tools 0 Tue Sep 05, 2017 10:16 am
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 21 Sun Aug 27, 2017 10:35 pm
No new posts Unable to copy data from spool in a d... srikant314 JCL & VSAM 8 Fri Jul 28, 2017 9:10 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts copy SEQ to PDS and create stats steve-myers JCL & VSAM 7 Thu Apr 27, 2017 1:15 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us