Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Utility to copy 1 file to N files.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
umeshkmrsh

New User


Joined: 21 Sep 2005
Posts: 79
Location: India

PostPosted: Thu Feb 23, 2006 7:52 pm    Post subject: Utility to copy 1 file to N files.
Reply with quote

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
View user's profile Send private message

DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Thu Feb 23, 2006 8:40 pm    Post subject: Re: Utility to copy 1 file to N files.
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Feb 23, 2006 10:07 pm    Post subject:
Reply with quote

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
View user's profile Send private message
umeshkmrsh

New User


Joined: 21 Sep 2005
Posts: 79
Location: India

PostPosted: Fri Feb 24, 2006 11:59 am    Post subject:
Reply with quote

Thank's Davidat and Frank for your for helping me out.
Back to top
View user's profile Send private message
ranga_subham

New User


Joined: 01 Jul 2005
Posts: 51

PostPosted: Wed Mar 08, 2006 8:24 pm    Post subject:
Reply with quote

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
View user's profile Send private message
martin9

Active User


Joined: 01 Mar 2006
Posts: 290
Location: Basel, Switzerland

PostPosted: Fri Mar 10, 2006 7:07 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Ayyappan

New User


Joined: 05 Jul 2005
Posts: 31
Location: India

PostPosted: Fri Mar 10, 2006 7:27 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Thiruppathi

New User


Joined: 12 Mar 2006
Posts: 2
Location: memphis,TN, USA

PostPosted: Sun Mar 12, 2006 7:07 pm    Post subject: Re: Utility to copy 1 file to N files.
Reply with quote

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
View user's profile Send private message
ranga_subham

New User


Joined: 01 Jul 2005
Posts: 51

PostPosted: Sat Mar 18, 2006 10:08 am    Post subject:
Reply with quote

Thanks a lot Ayyappan.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us