MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Process Datasets that are created today

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
sri50131
Beginner


Joined: 07 Oct 2004
Posts: 38
Topics: 15

PostPosted: Mon Jun 04, 2007 11:09 am    Post subject: Process Datasets that are created today Reply with quote

Hi,

I need to process the datasets created today in my JCL. Examples of the datasets:

ATEST.RKJ.APCAT417.BU47.EDSAC.D0530.T06
ATEST.RKJ.APCAT417.BU47.EDSAC.D0530.T10
ATEST.RKJ.APCAT417.BU47.EDSAC.D0530.T12
ATEST.RKJ.APCAT418.BU47.EDSAC.D0601.T06
ATEST.RKJ.APCAT418.BU47.EDSAC.D0601.T10
ATEST.RKJ.APCAT418.BU47.EDSAC.D0601.T12
ATEST.RKJ.APCAT419.BU47.EDSAC.D0604.T06
ATEST.RKJ.APCAT419.BU47.EDSAC.D0604.T08
ATEST.RKJ.APCAT419.BU47.EDSAC.D0604.T10
ATEST.SNEADJ1.UNRVPD34.BU87.EDSAC.D0604.T10
ATEST.ROYAP.UNRVPD36.BU87.EDSAC.D0604.T10
ATEST.FRIEDRP1.APCPE701.SR2B.EDSAC.D0604.T10


I need to process the files that were created today (06/04/07). The 6th node D0604 contains the created date.

Note: There could be some days that there are no files that were created, so the job should not abend if there are no datasets created that day.

Thanks for your help in advance.

Thanks in Advance for your help.
Back to top
View user's profile Send private message
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Mon Jun 04, 2007 11:44 am    Post subject: Reply with quote

Process them in what way ...............

Backups or what ?

This seems an ideal job for GDG's. Each file on arrival/generation triggers a batch job to copy it to a +1 GDG, which gets fed into the processing job, which then deletes the files after sucessful BACKUP and processing.

A following job to set up a null GDG version so that if there are no files in the next run, the null version will be read, and the whole process starts again.
_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Mon Jun 04, 2007 12:03 pm    Post subject: Reply with quote

Sri50131,

Please be clear whenever you ask anything....Dont make people guess.

You say that your 6th Node contains Date. Now, there should be some Job which creates these datasets with date on 6th Node. If so, the datasets will always be created if the job runs fine. Now, what makes you say that "If the files are NOT created" ???

Are these datasets created as part of any incoming transmission ??? Or the jobs that create these datasets are scheduled NOT to run on a specific day / time.

How many such jobs are you referring to and when you say "Process the files" - which job does that operation and when is it scheduled to run and what is it expected to do?

Thanks,
Phantom
Back to top
View user's profile Send private message
sri50131
Beginner


Joined: 07 Oct 2004
Posts: 38
Topics: 15

PostPosted: Mon Jun 04, 2007 2:17 pm    Post subject: Reply with quote

Phatom,

There is a job that runs every 2 hours (6 AM - 6 PM) Mon thru' Friday and creates the output files outlined. This job creates the output files that has a date in the 6th node. The output files will only be created if any input files come thru' this job. So, on some days there would be no input files, hence no output files. In this case, the new job should not abend but should complete successfully.

The new job will run daily Mon - Fri at 7:00 PM. The first thing the job should do is to scan for files that are created today and concatenate them into 1 file. The second step will process the data.

Thanks.
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Mon Jun 04, 2007 2:46 pm    Post subject: Reply with quote

Sri50131,

Solution 1:
Do you use any Job Scheduler in your shop ? If so, you could probably use Dataset Triggers and a combination of Time trigger. i.e the new job would initiate as soon as the required dataset gets created. But it would wait until the time specified.

This way you need not check for existence of your files. If the file is not created then the new job would not run at all.

Solution 2:
STEP 01. Use IDCAMS - LISTCAT to check the existence of a particular dataset. Capture the output of LISTC into a PS

STEP 02. Use Sort to set a return code of 4 if the dataset does not exist. See below
Code:

//R020   EXEC  PGM=SORT,PARM='NULLOUT=RC4'
//SORTIN   DD  DSN=input.from.step01,DISP=SHR
//SORTOUT DD  DUMMY
//SYSOUT   DD  SYSOUT=*
//SYSIN   DD  *
  SORT FIELDS=COPY
  INCLUDE COND=(1,80,SS,EQ,C'IN-CAT')
/*


Then use the COND CODE to bypass your Concat and Processing steps.

Hope this helps,

Thanks,
Phantom
Back to top
View user's profile Send private message
sri50131
Beginner


Joined: 07 Oct 2004
Posts: 38
Topics: 15

PostPosted: Mon Jun 04, 2007 3:22 pm    Post subject: Reply with quote

Phantom,

I have used LISTCAT in other jobs. Using LISTCAT, how do you specify to select only the files that are created today.

Thanks.
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Mon Jun 04, 2007 4:06 pm    Post subject: Reply with quote

Create the IDCAMS control card (for LISTCAT) Dynamically using Sort (you could get current date using sort - use OUTREC to reformat the date to whatever format your dataset name is) and then pass it to the IDCAMS step.

Hope this helps,

Thanks,
Phantom
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Mon Jun 04, 2007 4:47 pm    Post subject: Reply with quote

this is an example of using date in a DSN LLQ inorder to control processing. Such primitive methodologies require bits and bytes type processing.
Quote:
Using LISTCAT, how do you specify to select only the files that are created today.


You don't need creation date. Actually you only want those DSN's with a LLQ = Dddmm. Whatever nifty little process you used to create the Dddmm for the DSN's could also generate a parm to be used by your 1900hrs process to find and process the files.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Tue Jun 05, 2007 8:34 am    Post subject: Reply with quote

dbzTHEdinosauer,

I did not use LISTCAT to find the creation date. Rather, it was used to check the existence of datasets. I used SORT to get the date in Dddmm format.

Thanks,
Phantom
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Tue Jun 05, 2007 12:27 pm    Post subject: Reply with quote

If you can use the schedulers file tracker to not submit the 19:00 job then could you ot use the same process to not submit the daytime jobs? Having said that - why not have the daytime jobs create empty datasets if there is no input? Then you do not need to worry about datasets not existing.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Tue Jun 05, 2007 2:05 pm    Post subject: Reply with quote

Phantom,

I miss-read your previous post and was on a soap-box about DS naming conventions.

I would still use the same methodology used to generate the Dddmm and not introduce a new methodology, especially SORT - since it would more than likely generate an accurate ddmm, whereas the method used to generate the Dddmm may or may not have bugs.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group