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
 

 

Copying a dataset into two datasets

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

New User


Joined: 04 Aug 2008
Posts: 6
Location: chennai

PostPosted: Thu Nov 13, 2008 12:22 pm    Post subject: Copying a dataset into two datasets
Reply with quote

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

Amsar

New User


Joined: 26 Sep 2008
Posts: 84
Location: Chennai

PostPosted: Thu Nov 13, 2008 12:35 pm    Post subject: Reply to: Copying a dataset into two datasets
Reply with quote

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

New User


Joined: 04 Aug 2008
Posts: 6
Location: chennai

PostPosted: Thu Nov 13, 2008 12:47 pm    Post subject: Reply to: Copying a dataset into two datasets
Reply with quote

Thanks Amol,

I got the result. icon_lol.gif
Back to top
View user's profile Send private message
Amsar

New User


Joined: 26 Sep 2008
Posts: 84
Location: Chennai

PostPosted: Thu Nov 13, 2008 12:57 pm    Post subject: Reply to: Copying a dataset into two datasets
Reply with quote

Glad to hear icon_smile.gif
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Nov 13, 2008 1:16 pm    Post subject:
Reply with quote

Or
Code:

//SYSIN    DD    *     
  SORT FIELDS=COPY     
  OUTFIL FILES=(01,02)
/*                     
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2284
Location: @my desk

PostPosted: Thu Nov 13, 2008 1:40 pm    Post subject:
Reply with quote

Or even this icon_smile.gif
Code:
//SYSIN    DD    *     
  SORT FIELDS=COPY     
  OUTFIL FILES=01

SORTOUT will have a copy by default.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Thu Nov 13, 2008 8:53 pm    Post subject:
Reply with quote

Keep in mind that SORT will usually outperform IEBGENER or IDCAMS for copying purposes anyway.
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 Nov 13, 2008 11:05 pm    Post subject:
Reply with 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. 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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2284
Location: @my desk

PostPosted: Thu Nov 13, 2008 11:19 pm    Post subject:
Reply with quote

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

DFSORT Moderator


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

PostPosted: Thu Nov 13, 2008 11:28 pm    Post subject:
Reply with quote

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

Moderator


Joined: 17 Oct 2006
Posts: 2284
Location: @my desk

PostPosted: Fri Nov 14, 2008 12:06 am    Post subject:
Reply with quote

Frank,

Thank you !!
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 copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
No new posts REXX to get the all datasets name parasmalik20 CLIST & REXX 5 Tue Jul 18, 2017 9:10 pm
No new posts Browse dataset cvnlynn CLIST & REXX 4 Tue Jul 18, 2017 3:52 am
No new posts Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am


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