View previous topic :: View next topic
|
Author |
Message |
umeshkmrsh
New User
Joined: 21 Sep 2005 Posts: 79 Location: India
|
|
|
|
Hi guys,
I have a problem. I want to copy a flat file to multiple files using some JCL utility. I want to do this using single JCL STEP. Does anyone know any such utility?
Also, one more question related to this.
Say my JCL looks like this:
//STEP1 EXEC PGM=COBPRO
//INFILE DD DSN=<infile>
//OUTFILE DD DSN=<outfile1>
//OUTFILE DD DSN=<outfile2>
with multiple OUTPUT files with same ddname. And my program has FILE-CONTROL entry as shown below:
FILE-CONTROL.
SELECT COB-INFILE ASSIGN TO INFILE.
SELECT COB-OUTFILE ASSIGN TO OUTFILE.
Will I get compilation error? NO.
Will I get JCL error? I don?t know.
Will I get RUNTIME ABEND? I don?t know.
Or will program will write at the same time to both the output files. |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
Hi umeshkmrsh
Quote: |
I have a problem. I want to copy a flat file to multiple files using some JCL utility. I want to do this using single JCL STEP. Does anyone know any such utility?
|
There are a lot of utilities that you can use. I like to use IDCAMS for this type of copy. I'm sure you will hear from others with different solutions.
Code: |
//JS00100 EXEC PGM=IDCAMS
//INDD1 DD DSN=
//SYSPRINT DD SYSOUT=*
//OUTDD1 DD DSN=OUTPUT.DATASET1
//OUTDD2 DD DSN=OUTPUT.DATASET2
//SYSIN DD *
REPRO INFILE(INDD1) OUTFILE(OUTDD1)
REPRO INFILE(INDD1) OUTFILE(OUTDD2)
/*
|
Quote: |
Also, one more question related to this.
Say my JCL looks like this:
//STEP1 EXEC PGM=COBPRO
//INFILE DD DSN=
//OUTFILE DD DSN=<outfile1>
//OUTFILE DD DSN=<outfile2>
with multiple OUTPUT files with same ddname. And my program has FILE-CONTROL entry as shown below:
FILE-CONTROL.
SELECT COB-INFILE ASSIGN TO INFILE.
SELECT COB-OUTFILE ASSIGN TO OUTFILE.
|
Quote: |
Will I get JCL error? I don?t know.
|
A. You will not jet a JCL error with this
Quote: |
Will I get RUNTIME ABEND? I don?t know.
|
A. You will not get a RUNTIME ABEND
Quote: |
Or will program will write at the same time to both the output files.
|
A. You program will write to the file defined in the FIRST //OUTFILE DD. The second will be ignored at execution time
Dave, |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
I have a problem. I want to copy a flat file to multiple files using some JCL utility. I want to do this using single JCL STEP. Does anyone know any such utility? |
You can do this in one pass with DFSORT (as opposed to multiple passes with IDCAMS). For example:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//OUT1 DD DSN=... output file1
//OUT2 DD DSN=... output file2
//OUT3 DD DSN=... output file3
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=(OUT1,OUT2,OUT3)
/*
|
You can also do this in one pass with DFSORT's iCETOOL as follows:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file
//OUT1 DD DSN=... output file1
//OUT2 DD DSN=... output file2
//OUT3 DD DSN=... output file3
//TOOLIN DD *
COPY FROM(IN) TO(OUT1,OUT2,OUT3)
/*
|
|
|
Back to top |
|
|
umeshkmrsh
New User
Joined: 21 Sep 2005 Posts: 79 Location: India
|
|
|
|
Thank's Davidat and Frank for your for helping me out. |
|
Back to top |
|
|
ranga_subham
New User
Joined: 01 Jul 2005 Posts: 51
|
|
|
|
Hi,
Can anybody let me know how to achieve it using the SYNCSORT as we don't have DFSORT at our shop.
Thanks for your time. |
|
Back to top |
|
|
martin9
Active User
Joined: 01 Mar 2006 Posts: 290 Location: Basel, Switzerland
|
|
|
|
hy ranga,
use IDCAMS it is one of the most common IBM
utilities on a mainframe and always supplied with
any installation.
to know IDCAMS is a must for all mainframers.
martin9 |
|
Back to top |
|
|
Ayyappan
New User
Joined: 05 Jul 2005 Posts: 31 Location: India
|
|
|
|
Hi Ranga,
You can use the following JCL to copy a single file to multiple files.
Code: |
//STEP010 EXEC PGM=SORT
//SORTIN DD DSN=&HLQ..T21412.UNWAY.DETAIL,
// DISP=SHR
//SORTOF01 DD DSN=&HLQ..T21412.UNWAY.TEST1,
// DISP=(,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(25,5),RLSE),
// DCB=(*.SORTIN)
//SORTOF02 DD DSN=&HLQ..T21412.UNWAY.TEST2,
// DISP=(,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(25,5),RLSE),
// DCB=(*.SORTIN)
//SYSUDUMP DD SYSOUT=D
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSLIST DD SYSOUT=*
//SYSTOTAL DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=(01,02)
/*
|
Thanks.
Ayyappan |
|
Back to top |
|
|
Thiruppathi
New User
Joined: 12 Mar 2006 Posts: 2 Location: memphis,TN, USA
|
|
|
|
umeshkmrsh wrote: |
Hi guys,
I have a problem. I want to copy a flat file to multiple files using some JCL utility. I want to do this using single JCL STEP. Does anyone know any such utility?
Also, one more question related to this.
Say my JCL looks like this:
//STEP1 EXEC PGM=COBPRO
//INFILE DD DSN=<infile>
//OUTFILE DD DSN=<outfile1>
//OUTFILE DD DSN=<outfile2>
with multiple OUTPUT files with same ddname. And my program has FILE-CONTROL entry as shown below:
FILE-CONTROL.
SELECT COB-INFILE ASSIGN TO INFILE.
SELECT COB-OUTFILE ASSIGN TO OUTFILE.
Will I get compilation error? NO.
Will I get JCL error? I don?t know.
Will I get RUNTIME ABEND? I don?t know.
Or will program will write at the same time to both the output files. |
[color=blue]Answer for your query
1.For copying single input to multilple output you can use SORT utility
2. when use 2 dd name as a same you won't get any compilation errors but you should get JCl errors[/color] |
|
Back to top |
|
|
ranga_subham
New User
Joined: 01 Jul 2005 Posts: 51
|
|
|
|
Thanks a lot Ayyappan. |
|
Back to top |
|
|
|