SET a variable with a file name, HELP



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

SET a variable with a file name, HELP

Postby javivi » Thu Jan 27, 2011 2:31 pm

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.
javivi
 
Posts: 47
Joined: Fri Jan 21, 2011 2:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: SET a variable with a file name, HELP

 

Re: SET a variable with a file name, HELP

Postby dick scherrer » Thu Jan 27, 2011 2:33 pm

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: SET a variable with a file name, HELP

Postby javivi » Thu Jan 27, 2011 2:35 pm

Thaks, but I can't use internal reader and neither a program, I need to do it only with JCL.

Thanks again.
javivi
 
Posts: 47
Joined: Fri Jan 21, 2011 2:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: SET a variable with a file name, HELP

Postby dick scherrer » Thu Jan 27, 2011 2:42 pm

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
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: SET a variable with a file name, HELP

Postby javivi » Thu Jan 27, 2011 2:49 pm

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
javivi
 
Posts: 47
Joined: Fri Jan 21, 2011 2:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: SET a variable with a file name, HELP

Postby NicC » Thu Jan 27, 2011 7:32 pm

we can say that DFSORT is a program

we could but we wouldn't because DFSORT IS a program
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: SET a variable with a file name, HELP

Postby Robert Sample » Thu Jan 27, 2011 7:43 pm

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.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: SET a variable with a file name, HELP

Postby javivi » Thu Jan 27, 2011 10:04 pm

Hi all

Ok, Thanks a lot by all your help.

Regards from Spain.
javivi
 
Posts: 47
Joined: Fri Jan 21, 2011 2:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: SET a variable with a file name, HELP

Postby Blackthorn » Tue Feb 01, 2011 7:20 pm

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.
Blackthorn
 
Posts: 98
Joined: Tue Feb 01, 2011 7:12 pm
Has thanked: 0 time
Been thanked: 2 times

Re: SET a variable with a file name, HELP

Postby dick scherrer » Wed Feb 02, 2011 1:35 am

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
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post