They must be copied to destination dataset as below which are defined of the same parameters as above.
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.
Where TOPPZZZ.SYSIN(FILECOPY), has below statement.
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.
Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix
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.
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.
Joined: 06 Jun 2008 Posts: 8165 Location: East Dubuque, Illinois, USA
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 *.
//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.