View previous topic :: View next topic
|
Author |
Message |
sathish1760
New User
Joined: 02 May 2008 Posts: 42 Location: chennai
|
|
|
|
I am working in JCL for merging of datasets.My requirement is that if one of the datsets given in the merge step is not catalogued,it should not through 'DATSET NOT FOUND' error and other datsets should be merged.If anyone knows the solution for this,please help me.
Thanks in advance,
sathish |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Sathish,
What if none of the datasets to be merged are catalogued? |
|
Back to top |
|
|
sathish1760
New User
Joined: 02 May 2008 Posts: 42 Location: chennai
|
|
|
|
Hi arcvns,
Even when none of the datasets are catalogued, my JCL should not through 'DATSET NOT FOUND' and output dataset should be empty.
Is it possible to skip that uncatalogued dataset and merge the other catalogued datasets? |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
How about using DISP=(MOD,CATLG) for SORTINxx datasets? |
|
Back to top |
|
|
sathish1760
New User
Joined: 02 May 2008 Posts: 42 Location: chennai
|
|
|
|
Hi arun,
I am not creating the input datasets during merge step in my JCl.I just have to merge the datsets if they are catalogued. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Then you need a procedure to see which files are available for input and generate your JCL accordingly.
Another possibility may be to create all inputs as generations of a GDG and only take the base as input. Not sure if this is feasible for a merge ? but you could always investigate. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
I am not creating the input datasets during merge step in my JCl.I just have to merge the datsets if they are catalogued. |
The below sample job works merges the input files evenif any/all of the input datasets are not catalogued. It'll create the datasets which are not available. If you don't want them to be catalogued, you need to figure out alternate methods as expat suggested.
Code: |
//STEP01 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN01 DD DSN=Input.file1,DISP=(MOD,CATLG),
// DCB=LRECL=80,SPACE=(TRK,(1,1))
//SORTIN02 DD DSN=Input.file2,DISP=(MOD,CATLG),
// DCB=LRECL=80,SPACE=(TRK,(1,1))
//SORTIN03 DD DSN=Input.file3,DISP=(MOD,CATLG),
// DCB=LRECL=80,SPACE=(TRK,(1,1))
//SORTOUT DD SYSOUT=*
//SYSIN DD *
MERGE FIELDS=(1,80,CH,A)
/* |
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
This may work as long as all of the sortin files are on sms-managed dasd. If any of the dasd is not sms-managed, there may be a problem.
Writing a specific eof to the end each file should perevent the non-sms problem as well as ensure the "dataset not found" error is prevented. |
|
Back to top |
|
|
sathish1760
New User
Joined: 02 May 2008 Posts: 42 Location: chennai
|
|
|
|
Finally it is done.I wrote a rexx routine to check whether the file is in the catalogue.
SYSDSN function in REXX is used for this purpose. So, i called the REXX routine for all the input datasets to check whether the files are in the catalogue.
Thanks you all for your response. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Thank you for posting your solution - good to hear it is working
d |
|
Back to top |
|
|
|