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

dataset not found error in merge JCL


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

New User


Joined: 02 May 2008
Posts: 42
Location: chennai

PostPosted: Wed Nov 05, 2008 11:35 am
Reply with quote

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

Moderator


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

PostPosted: Wed Nov 05, 2008 11:38 am
Reply with quote

Sathish,

What if none of the datasets to be merged are catalogued?
Back to top
View user's profile Send private message
sathish1760

New User


Joined: 02 May 2008
Posts: 42
Location: chennai

PostPosted: Wed Nov 05, 2008 11:46 am
Reply with quote

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

Moderator


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

PostPosted: Wed Nov 05, 2008 11:49 am
Reply with quote

How about using DISP=(MOD,CATLG) for SORTINxx datasets?
Back to top
View user's profile Send private message
sathish1760

New User


Joined: 02 May 2008
Posts: 42
Location: chennai

PostPosted: Wed Nov 05, 2008 12:02 pm
Reply with quote

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

Global Moderator


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

PostPosted: Wed Nov 05, 2008 12:13 pm
Reply with quote

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

Moderator


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

PostPosted: Wed Nov 05, 2008 12:32 pm
Reply with quote

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

Moderator Emeritus


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

PostPosted: Wed Nov 05, 2008 1:36 pm
Reply with quote

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

New User


Joined: 02 May 2008
Posts: 42
Location: chennai

PostPosted: Wed Nov 05, 2008 6:43 pm
Reply with quote

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

Moderator Emeritus


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

PostPosted: Wed Nov 05, 2008 9:16 pm
Reply with quote

Thank you for posting your solution - good to hear it is working icon_smile.gif

d
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 Error to read log with rexx CLIST & REXX 11
No new posts How I Found a Bug in a FORTRAN Compiler All Other Mainframe Topics 4
No new posts Error when install DB2 DB2 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
Search our Forums:

Back to Top