View previous topic :: View next topic
|
Author |
Message |
krsenthil85
New User
Joined: 31 Aug 2007 Posts: 55 Location: bangalore
|
|
|
|
I have three Dataset A, B and C
I need to copy A to A1, B to B1 and C to C1. I should do all this copy within a single step. Could you please provide sample JCL to achieve this. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can use a DFSORT job like the following to do what you asked for.
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//A DD DSN=... input file A
//B DD DSN=... input file B
//C DD DSN=... input file C
//A1 DD DSN=... output file A1
//B1 DD DSN=... output file B1
//C1 DD DSN=... output file C1
//TOOLIN DD *
COPY FROM(A) TO(A1)
COPY FROM(B) TO(B1)
COPY FROM(C) TO(C1)
/*
|
|
|
Back to top |
|
|
krsenthil85
New User
Joined: 31 Aug 2007 Posts: 55 Location: bangalore
|
|
|
|
Thanks frank |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
I ask the question, what is the big deal about a single step job when there are no savings, ?
If copy 2 or copy 3 fail, you will need to rerun the entire job amd depending on the size of the files you are copying it could be a significant amount of time lost.
Gerry |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
Hi Gerry !
The only big deal is, that there is a possibility to do it.
"Omnes Viae Ducunt Romam" as i learned in classical Latin years ago. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi Umeysan,
capisco, I learned that in Italy.
Gerry |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
The only big deal is, that there is a possibility to do it. |
And if a thing can be done (i.e. is possible) someone will find a way to make it a requirement, not just an option. . .
I firmly believe that not everything that can be done should be done. . . |
|
Back to top |
|
|
krsenthil85
New User
Joined: 31 Aug 2007 Posts: 55 Location: bangalore
|
|
|
|
Hi,
Can we do the same with IDCAM Utility. If yes could please let me know
Quote: |
what is the big deal about a single step job when there are no savings |
Answer:
We have some program which is generating reports and directly sending to VIS, but now it is needed to send to Dataset and then to reports instead of direct routing from program to Reports. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
but now it is needed to send to Dataset and then to reports instead of direct routing from program to Reports. |
Ok, but why does this need to be done in a single step?
If the report volume is small, you might use idcams, but if there is high volume, using the sort for the copy is a far better choice. |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
The advantage of running these copies in 3 separate jobs is that they can run in parallel and are rerunable separately. I also believe in "just because a task can be run one way doesn't mean it should be". |
|
Back to top |
|
|
krsenthil85
New User
Joined: 31 Aug 2007 Posts: 55 Location: bangalore
|
|
|
|
Hi Dick,
Quote: |
Ok, but why does this need to be done in a single step? |
In my JCL each step is generating nearly 30 Reports.
So now my process is I will send the reports to Dataset and if I use IDCAMS it will increase around 30 steps. So i want to do this in a single step. |
|
Back to top |
|
|
maheshvamsi
New User
Joined: 22 Mar 2008 Posts: 39 Location: bangalore
|
|
|
|
you can do it by using idcams.
Code: |
//COPY01 EXEC PGM=IDCAMS,REGION=4M
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//IN1 DD DISP=SHR,DSN= input file 1
//IN2 DD DISP=SHR,DSN= inut file 2
//IN3 DD DISP=SHR,DSN= input file 3
//OUT DD SYSOUT=*
//OUT1 DD SYSOUT=*
//OUT2 DD SYSOUT=*
//SYSIN DD *
REPRO INFILE(IN1) OUTFILE(OUT) REPLACE
REPRO INFILE(IN2) OUTFILE(OUT1) REPLACE
REPRO INFILE(IN3) OUTFILE(OUT2) REPLACE
/* |
|
|
Back to top |
|
|
krsenthil85
New User
Joined: 31 Aug 2007 Posts: 55 Location: bangalore
|
|
|
|
Thanks Mahes. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Why did you switch to idcams - the more resource wasting alternative. . .?
You were given a sort solution before idcams was even mentioned |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
I think you'll find that SORT will usually outperform most other programs to accomplish a copy. |
|
Back to top |
|
|
|