MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How copy even records from a input dataset thru JCL

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
Prosenjit2
Beginner


Joined: 02 Mar 2005
Posts: 13
Topics: 8
Location: India

PostPosted: Wed Jul 13, 2005 5:56 am    Post subject: How copy even records from a input dataset thru JCL Reply with quote

I want to copy the even records of an input dataset to an output file.
Can somebody provide me the JCL to do it.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Jul 13, 2005 6:18 am    Post subject: Reply with quote

Prosenjit2,

The following JCL will give you the desired results.

Code:

//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=YOUR INPUT FILE,
//            DISP=SHR
//OUT1     DD DUMMY
//OUT2     DD DSN=YOUR EVEN RECORDS FILE,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA
//            SPACE=(CYL,(X,Y),RLSE)
//SYSIN DD *
  SORT FIELDS=COPY
  OUTFIL FNAMES=(OUT1,OUT2),SPLIT
/*


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Prosenjit2
Beginner


Joined: 02 Mar 2005
Posts: 13
Topics: 8
Location: India

PostPosted: Wed Jul 13, 2005 6:39 am    Post subject: Reply with quote

thank you very much the jcl worked.
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Wed Jul 13, 2005 10:45 am    Post subject: Reply with quote

Here's another way to do it with DFSORT that doesn't require the extra DUMMY output:

Code:

//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN DD *
     OPTION COPY
     OUTFIL STARTREC=2,SAMPLE=2   
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group