View previous topic :: View next topic
|
Author |
Message |
ponkala
New User
Joined: 04 Aug 2008 Posts: 6 Location: chennai
|
|
|
|
Hi,
I want to copy a dataset into two different datasets which are created during copy.These should be done in single STEP.
I have used IEBGENER utility,But,It copied only one dataset,which i created first.
can anyone help me to find out?
Thanks,
Ponkala |
|
Back to top |
|
|
Amsar
New User
Joined: 26 Sep 2008 Posts: 84 Location: Chennai
|
|
|
|
Ponkala,
You can do it through sort.
Code: |
//XXXXXXXX JOB (QQQQ),'SORT JOB',CLASS=I,MSGCLASS=X,
// NOTIFY=&SYSUID,REGION=4096K
//STEP00 EXEC PGM=SORT
//*
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTMSG DD SYSOUT=*
//*
//SORTIN DD DSN=input---,DISP=SHR
//SORTOF01 DD DSN=output1---,DISP=SHR
//SORTOF02 DD DSN=output2----,DISP=SHR
//*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=01
OUTFIL FILES=02
//* |
Regards,
Amol |
|
Back to top |
|
|
ponkala
New User
Joined: 04 Aug 2008 Posts: 6 Location: chennai
|
|
|
|
Thanks Amol,
I got the result. |
|
Back to top |
|
|
Amsar
New User
Joined: 26 Sep 2008 Posts: 84 Location: Chennai
|
|
|
|
Glad to hear |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Or
Code: |
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=(01,02)
/*
|
|
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Or even this
Code: |
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=01 |
SORTOUT will have a copy by default. |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
Keep in mind that SORT will usually outperform IEBGENER or IDCAMS for copying purposes anyway. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Not sure why people continue to use FILES=nn and SORTOFnn when sort products have had the FNAMES=ddname parameter available for a very long time. A more "modern" DFSORT job for this situation would be:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//OUT1 DD DSN=... output file1
//OUT2 DD DSN=... output file2
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=(OUT1,OUT2)
/*
|
You could also do it with DFSORT's ICETOOL like this:
Code: |
//S2 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file
//OUT1 DD DSN=... output file1
//OUT2 DD DSN=... output file2
//TOOLIN DD *
COPY FROM(IN) TO(OUT1,OUT2)
/*
|
|
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
Not sure why people continue to use FILES=nn and SORTOFnn when sort products have had the FNAMES=ddname parameter available for a very long time. |
Frank,
Do we have any advantage by using FNAMES over FILES in DFSORT particularly for this case? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Just readability and ease of use. The full ddname is easier to use and understand than using a parameter with two characters of the ddname (FILES=01) and 'SORTOF' prepended to those two characters.
Note also that with FILES=dd, the use of the SORTDD=cccc parameter requires ccccOFdd (e.g. SORTDD=ABCD requires ABCDOF01 instead of SORTOF01), whereas FNAMES=ddname is NOT affected by SORTDD. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Frank,
Thank you !! |
|
Back to top |
|
|
|