Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 2287
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: 2287
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: 2287
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 ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Copying part of the report using SARBCH Aedulla CA Products 1 Tue Oct 24, 2017 9:24 am
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us