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

Splitting dataset and checking for empty dataset


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ssk1711

New User


Joined: 16 Jun 2008
Posts: 40
Location: bangalore

PostPosted: Tue Nov 11, 2008 3:31 pm
Reply with quote

Hi

I got a requirement like-

"One of our Job gives an output dataset, which is processed by a Java application. whenever, the number of records in the dataset is less than 10000, the java application will process it successfully. If the number of records in the dataset is more than 10000, then we have to split the output data set into number of dataset each containing less than 10000 records."

Note:- Also we know, the number of records in output file will not exceed 100,000 records.

solution what I thought about is-
"we will split the output dataset in to 10 dataset in the first step and the next step will delete the empty datasets"

Note:- we have SYNCSORT in our shop

Question:- Will this solution is efficient enough or is there any other simple way of meeting this requirement ?

Thanks a lot.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Tue Nov 11, 2008 4:02 pm
Reply with quote

Ssk,

Quote:
we will split the output dataset in to 10 dataset in the first step and the next step will delete the empty datasets"


Is this an one time requirement?

Quote:
Will this solution is efficient enough or is there any other simple way of meeting this requirement ?


This is for sure not the best approach. You will have to dynamically find the no of records and split accordingly. Instead of spliting adn then deleting.
Back to top
View user's profile Send private message
ssk1711

New User


Joined: 16 Jun 2008
Posts: 40
Location: bangalore

PostPosted: Tue Nov 11, 2008 4:13 pm
Reply with quote

I was also thinking that the dynamic approach to splitting the file would be the best to go about this issue. However I am not aware of how to use SYNCSORT to find the number of records and allocate it dynamically.

Would you please guide me to that?
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Tue Nov 11, 2008 4:54 pm
Reply with quote

Ssk,

Quote:
However I am not aware of how to use SYNCSORT to find the number of records and allocate it dynamically.


I would go for REXX for this requirement.

For SYNCSORT, wait for ALISSA to respond.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Nov 11, 2008 6:16 pm
Reply with quote

Quote:
However I am not aware of how to use SYNCSORT to find the number of records and allocate it dynamically.
ssk1711,

You might want to see this previous topic.
Back to top
View user's profile Send private message
ssk1711

New User


Joined: 16 Jun 2008
Posts: 40
Location: bangalore

PostPosted: Wed Nov 12, 2008 11:43 am
Reply with quote

Thanks Arun.

I gone thru the link and the JCL. The JCL generates another JCL that will have the split statements (the number of split statements is dynamically generated) in it. This generated JCL needs to be submitted either manually or thru the next step in the first JCL.

But, In our shop, we are not suppose to submit a JCL in production and also, we should not submit a JCL thru another JCL (only the scheduler will submit JCL ) !

So, give this case, how can we split it in a same JOB using SYNCSORT (since we have SYNCSORT in our shop)

Thanks,
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Nov 12, 2008 12:03 pm
Reply with quote

ssk1711,

For dynamic allocation, you'll have to create the DD statements dynamically. That means at least some part of your jcl will be different every time depending on the input record count.

One possibility I see is to split this into two jobs. In the first job write the DD statements into a pds member as well as the sort card for the second job. "INCLUDE" the member in your second job. Even if it is doable I personally feel it a bit complex and difficult to maintain. So going for REXX might be an easy solution for this. It's upto you to decide.
Back to top
View user's profile Send private message
ssk1711

New User


Joined: 16 Jun 2008
Posts: 40
Location: bangalore

PostPosted: Wed Nov 12, 2008 4:03 pm
Reply with quote

Thanks Arun.

Even, one of my team member gave that idea. But finally we have decided to do it with REXX.

Thanks once again.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Wed Nov 12, 2008 5:49 pm
Reply with quote

Ssk,

Quote:
But finally we have decided to do it with REXX.


Great. Do code and post if you find any issues.
Back to top
View user's profile Send private message
sajjan jindal
Warnings : 1

New User


Joined: 09 Sep 2007
Posts: 60
Location: india

PostPosted: Mon Jul 06, 2009 4:48 pm
Reply with quote

Senthil,

I suppose you must have posted your solution here, so that anyone else looking for the same problem could have found it helpful.

Are we here to only post the question or to give the solutions as well. I believe it should be Give and take,rather than being just take and take.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Mon Jul 06, 2009 5:00 pm
Reply with quote

Sajjan,

Quote:
Are we here to only post the question or to give the solutions as well. I believe it should be Give and take,rather than being just take and take.


Exactly.

But no point as it's been almost 8 months since the last post on this topic.
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 -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
Search our Forums:

Back to Top