Hi, I have a requirement that I have files in One test region and exactly the same set of files need to be copied for use in another test region. Hence I just have to change the second qualifier. Since the files are huge in number I got to do it by some shorter way. Can anyone help me with suggetions ?
E.g MAN.AHAM.FILES.** is to be copied to MAN.PARAM.FILES.**
The qualifiers following the 3rd qualifier (FILES) are random but I want exact replica of all the filenames(and contents) except for the second qualifier.
Joined: 03 Jul 2007 Posts: 1288 Location: Chennai, India
find below the REXX code. You will have to make few changes according to your requirement.
The below code is for changing the second qualifier to UATT and then creating it with the same attributes. You will have to make some changes for copying it instead of just creating it. You can use 'TSO COPY' for the same.
First you shd have a dataset with the list of all the files that needs to be copied.
/* REXX */
FILE14=your.file.name /* which is nothing but u r dataset which */
/*wud have the list of all datasets that needs to be changed */
"execio * diskr dtset14 (stem B.)"
DO J = 1 TO B.0
b.j = strip(b.j)
len = length(b.j)
posx = pos(".",B.J)
lstr = left(b.j,posx)
rstr = right(b.j,POSX+3)
line = lstr||"UATT"||rstr