Page 1 of 1

SET a variable with a file name, HELP

PostPosted: Thu Jan 27, 2011 2:31 pm
by javivi
Hi

I need to copy a file into other, the problem is that the source file name is into a file and i don't know do it.
Example:
FILE1 have only one record with a file name: DES.FILES.FOND.F110115

I need to copy the file DES.FILES.FOND.F110115 into the file DES.FILES.FOND.YESCOPY

The FILE1 will change every day and I never now the inside file name...

(I can't use catalogued procedures in my installation)

Help please.

Thanks.

Re: SET a variable with a file name, HELP

PostPosted: Thu Jan 27, 2011 2:33 pm
by dick scherrer
Hello,

One way to do this is to read the file with the dataset name and generate new jcl including this name.

Submit the newly generated jcl to the system via the Internal Reader.

Re: SET a variable with a file name, HELP

PostPosted: Thu Jan 27, 2011 2:35 pm
by javivi
Thaks, but I can't use internal reader and neither a program, I need to do it only with JCL.

Thanks again.

Re: SET a variable with a file name, HELP

PostPosted: Thu Jan 27, 2011 2:42 pm
by dick scherrer
but I can't use internal reader and neither a program, I need to do it only with JCL.

Sorry, but that is nonsense. . . .

Any JCL ever submitted/executed will only execute some program(s).

JCL cannot do anything like this by itself.

And the Internal Reader is simply a JCL specification. . .

d

Re: SET a variable with a file name, HELP

PostPosted: Thu Jan 27, 2011 2:49 pm
by javivi
Yes, a lot of sense, for example, you can use DFSORT instead a simple COBOL program who compare two files and generate a new file with the diference betwee the two files, isn't it? (ok, ok, we can say that DFSORT is a program...)

That is the case, I need to compare 2 files ("yesterday" file and "today" file) with dfsort and generate 3 files (with new records between yesterday and today, records deleted from yesterday to today, and ammended records from yesterday and today).
The comparation with dfsort is easy and it is done, but problem is that the "yesterday" file is into a file.

Thaks

Re: SET a variable with a file name, HELP

PostPosted: Thu Jan 27, 2011 7:32 pm
by NicC
we can say that DFSORT is a program

we could but we wouldn't because DFSORT IS a program

Re: SET a variable with a file name, HELP

PostPosted: Thu Jan 27, 2011 7:43 pm
by Robert Sample
What you want to do cannot be done with a single job. Once submitted, JCL goes through the JES converter / interpreter. After going through the converter / interpreter, the JCL cannot be changed -- in any way, for any reason, by any program, process, or person. Hence if your job executes a program to read the file name, you absolutely MUST submit another job to include that file name -- it cannot be any part of the executing JCL.

As your problem is stated, you either use the internal reader directly or set up some process to update an INCLUDE member or PROCLIB member to point to the new data set -- and then somehow a second job will be submitted to use the INCLUDE or PROCLIB in that job. If this is not an acceptable approach (due to not being able to use the internal reader or some other hogwash), then you must go back to whoever gave you the assignment and tell them it cannot be done under the conditions imposed.

Re: SET a variable with a file name, HELP

PostPosted: Thu Jan 27, 2011 10:04 pm
by javivi
Hi all

Ok, Thanks a lot by all your help.

Regards from Spain.

Re: SET a variable with a file name, HELP

PostPosted: Tue Feb 01, 2011 7:20 pm
by Blackthorn
I think it could be done within one job. If use IDCAMS to do the copy, then the dataset name can be specified in the SYSIN rather than in the JCL.

So the first step would be a program such as Rexx to read FILE1, get the file name to be copied and generate the IDCAMS SYSIN statements, and then run the IDCAMS program to peform the copy.

Re: SET a variable with a file name, HELP

PostPosted: Wed Feb 02, 2011 1:35 am
by dick scherrer
Hello and welcome to the forum,

When providing a "solution" one must follow the rules given for the posted requirement (even if they make no sense) . . .

Possibly TS will provide some updated "rules" and we can better provide help. . .

d