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

Empty Data set and empty member handling


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

New User


Joined: 18 Oct 2006
Posts: 23
Location: bangalore

PostPosted: Sun Aug 23, 2009 1:15 pm
Reply with quote

We are receiving more than 1000 files every day which are of the below format.

DSN=TOPPXXX.DATASET1
UNIT=PERMDA,
RECFM=U,
LRECL=80,
DSORG=PO,
DSNTYPE=LIBRARY,
BLKSIZE=19069,
SPACE=(CYL,(250,100))


DSN=TOPPXXX.DATASET2
UNIT=PERMDA,
SPACE=(CYL,(20,100,500),RLSE),
DCB=(DSORG=PO,RECFM=FB,LRECL=80,BLKSIZE=27920)


They must be copied to destination dataset as below which are defined of the same parameters as above.


TOPPYYY.DATASET1
TOPPYYY.DATASET2

Some thing like

TOPPXXX.DATASET1 to TOPPYYY.DATASET1
TOPPXXX.DATASET2 to TOPPYYY.DATASET2

Here is the PRoblem.

we may or may not received all the 1000 TOPPXXX.* datasets. So I created a JCL to copy all the members from
TOPPXXX.DATASET1 to TOPPYYY.DATASET1. But my JCL ABENDS since we wont receive all the data set at the same time.

Is there a way I can automate this, So that DATASET NOT FOUND condition can be handled.

I have gone though some of the posts and I was not able to understand REX. Is there a way to do this using JCL?

I also Need one thing. Is there a way to check TOPPXXX.DATASET1(member1) is EMPTY or not?

Some times we receive ONLY one member which will be EMPTY and that must not be copied. This is a Unique Senario.

Any help on this I vill be very happy to work.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Sun Aug 23, 2009 1:24 pm
Reply with quote

Quote:
So I created a JCL to copy all the members from
TOPPXXX.DATASET1 to TOPPYYY.DATASET1.


Using what?
Any built-in utility or have you written any program for that.


Quote:
Is there a way to do this using JCL?

JCL can not do so... icon_eek.gif Do you mean you want to do in batch?
Back to top
View user's profile Send private message
mvenkatesha

New User


Joined: 18 Oct 2006
Posts: 23
Location: bangalore

PostPosted: Sun Aug 23, 2009 10:50 pm
Reply with quote

Code:
//DELT1  EXEC PGM=IEFBR14,                                             
//            COND=(7,LT)                                             
//SYSUT1   DD DSN=TOPPXXX.DATASET1,
//            DISP=(MOD,DELETE,DELETE),                               
//            UNIT=PERMDA,                                             
//            SPACE=(TRK,(2,1,10),RLSE),                               
//            DCB=(DSORG=PO,RECFM=U,LRECL=80,BLKSIZE=27998)           
//*                                                                   
//*********************************************************************
//*  COPY DATA                                                        *
//*********************************************************************
//COPY1  EXEC PGM=IEBCOPY,                                             
//            COND=(7,LT),                                             
//            REGION=4M                                               
//SYSUT1   DD DSN=TOPPXXX.DATASET1,
//            DISP=(SHR,KEEP,KEEP)                                     
//SYSUT2   DD DSN=TOPPYYY.DATASET1,
//            DISP=(NEW,CATLG,DELETE),                                 
//            UNIT=PERMDA,                                             
//            RECFM=U,                                                 
//            LRECL=80,                                               
//            DSORG=PO,                                               
//            DSNTYPE=LIBRARY,                                         
//            BLKSIZE=19069,                                           
//            SPACE=(CYL,(250,100))                                   
//SYSUT3   DD UNIT=SYSDA,                                             
//            SPACE=(TRK,(10))                                         
//SYSUT4   DD UNIT=SYSDA,                                             
//            SPACE=(TRK,(10))                                         
//SYSIN    DD DSN=TOPPZZZ.SYSIN(FILECOPY),                   
//            DISP=(SHR,KEEP,KEEP)                                     
//SYSPRINT DD SYSOUT=*                                                 
//SYSOUT   DD SYSOUT=*   




Where TOPPZZZ.SYSIN(FILECOPY), has below statement.
COPY INDD=((SYSUT1,R)),OUTDD=SYSUT2


Though I dont know CLIST we have that in our SYSTEM. So if not worked out in JCL and if there are other ways to do this, I still want to try since Copying 1000 datasets every day it's lot of pain. We are sometimes making mistake due to manual interaction causing issues.
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: Mon Aug 24, 2009 6:37 am
Reply with quote

Hello,

Quote:
I am posting this to DFSORT Forum as well. To see if there is a way to handle this?
Providing an announcement still does not permit double-posting. . . The duplicate has been removed.

A process to do what you want might accomplished by generating the custom jcl and control statements for each file for each run. When you searched the forum, there would have been examples of how to determine if a file exists or not (i.e. using the output of an idcams/listcat as input).

For each file that exists, generate the jcl/control statements to copy the entire dataset - not the individual members.

You can use idcams/repro, your sort product, fileaid, or easytrieve to determine if some particular member is empty.

The process that generates the copy jcl would submit this thru the "internal reader" (there are also examples of these in the forum).

If there are questions/problems as you proceed, post them here and someone should be able to clarify.

Later, if you learn REXX, you might shorten the process from multiple steps.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Aug 24, 2009 3:06 pm
Reply with quote

This thread has taken many shapes, not sure if you are still intrested in this
Quote:
I also Need one thing. Is there a way to check TOPPXXX.DATASET1(member1) is EMPTY or not?
If yes, here is a way to do that
Code:
//******************************************************
//* FILE NOT EXISTING :  RC = 12                       
//* EMPTY FILE        :  RC = 04                       
//* DATA FILE         :  RC = 00                       
//******************************************************
//STEP010  EXEC PGM=IDCAMS                             
//SYSUDUMP DD SYSOUT=C                                 
//SYSOUT   DD SYSOUT=*                                 
//SYSPRINT DD SYSOUT=*                                 
//FILEIN   DD DSN=pds.name(EMPTYMEM),DISP=SHR
//SYSIN    DD *                                         
  PRINT INFILE(FILEIN) -                               
      CHARACTER COUNT(1)                               
/*                                                     
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Mon Aug 24, 2009 3:48 pm
Reply with quote

Hi Anuj,

if the file does not exist, it's more likely to return a JCL error, but if the member does not exist then it will result in a return code of 12.


Gerry
Back to top
View user's profile Send private message
mvenkatesha

New User


Joined: 18 Oct 2006
Posts: 23
Location: bangalore

PostPosted: Mon Aug 24, 2009 10:36 pm
Reply with quote

Hi dick, I am sorry for posting the query at multiple locations.

I first used the IDCSMS PRINT IN FILE but it did not work for me.

Then I used the below SYNTAX.

Code:
//STEP100  EXEC PGM=IDCAMS       
//SYSUDUMP DD SYSOUT=*           
//SYSOUT   DD SYSOUT=*           
//SYSPRINT DD SYSOUT=*           
//SYSIN DD *                     
  LISTCAT ENTRIES('TOPPXXX.AAA.INFILE1')


It worked for me. If data set is present it will give RC = 0 and if not it will provide RC = 4. This is what I wanted but I have one more problem to fix my query and to create a generic JCL.

I forgot to mention in my First Query posted. If you Look at the Second Qualifier AAA it will change for every run. Since I am using it in SYSIN I cannot pass it using Symbolic parameter to PROC. Is there a way this can be handled.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Aug 24, 2009 10:40 pm
Reply with quote

If you know in advance what the value is for the second qualifier, use a program or utility to create your LISTCAT statement in a PDS member and point your IDCAMS JCL to the PDS member instead of using SYSIN DD *.
Back to top
View user's profile Send private message
mvenkatesha

New User


Joined: 18 Oct 2006
Posts: 23
Location: bangalore

PostPosted: Thu Aug 27, 2009 7:22 am
Reply with quote

Code:
//STEP100  EXEC PGM=ICETOOL                 
//TOOLMSG  DD SYSOUT=*                     
//DFSMSG   DD SYSOUT=*                     
//SYSUDUMP DD SYSOUT=*                     
//SYSOUT   DD SYSOUT=*                     
//SYSPRINT DD SYSOUT=*                     
//IN DD DSN=TOPPXXX.DATA(EMPTYNO),DISP=SHR 
//TOOLIN DD *                               
* SET RC=4 IF THE 'IN' DATA SET IS EMPTY, OR
* SET RC=0 IF THE 'IN' DATA SET IS NOT EMPTY
  COUNT FROM(IN) RC4 EMPTY                 
/*


This works really great for me and Thank you for all your help.
I am still working on the Generating LISTCAT statements, I will post after the successful run.
I feel for every one we must research this forum many times before we ask a question. I could see most of the problems we face daily have been already answered.

Thanks to all solution providers for giving your valuable time, I can say this is the best mainframe Help site I have ever seen with really knowledgeable team responding queries.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Aug 27, 2009 4:52 pm
Reply with quote

Quote:
I feel for every one we must research this forum many times before we ask a question. I could see most of the problems we face daily have been already answered.
Whole heartly accepted... icon_biggrin.gif
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 Store the data for fixed length COBOL Programming 1
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts JCL EXEC PARM data in C Java & MQSeries 2
Search our Forums:

Back to Top