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
 

 

alternate records frominput file

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

Active User


Joined: 19 Feb 2005
Posts: 112
Location: chennai

PostPosted: Thu Feb 02, 2006 7:17 pm    Post subject: alternate records frominput file
Reply with quote

Hi,

I want to split a data set in such a way that one file should contain all even number records and the second file should contain all the odd number records means like below.............

if input file has records like
1 2 3 4 5 6 7 8 9 10 11 12.....................like so on and so forth

I need to split this file as below......

first file should have
1 3 5 7 9 ...................records like

and

second file should have
2 4 6 8 10 12 ....................records like

thx in adv..................

pavan
Back to top
View user's profile Send private message

rajesh_1183

Active User


Joined: 24 Nov 2005
Posts: 121
Location: Tadepalligudem

PostPosted: Thu Feb 02, 2006 7:34 pm    Post subject:
Reply with quote

Quote:
1 2 3 4 5 6 7 8 9 10 11 12.....................like so on and so forth

is this a single record...???? icon_question.gif or ur record organization is
1
2
3
4
5
.
.
.


Rajesh...
Back to top
View user's profile Send private message
rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Thu Feb 02, 2006 9:18 pm    Post subject:
Reply with quote

//SYSIN DD *

SORT FIELDS=COPY
OUTFIL FILES=(1,2),SPLIT
/*


After executing this sort job with this sysin, every 1 and 2nd records will go into output files respectively.(there should be two output files specified.

Regards
Jai
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 02, 2006 10:37 pm    Post subject:
Reply with quote

pavan,

Expanding on jai's response, you can use a DFSORT job like this to do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN                 
//SYSOUT    DD  SYSOUT=*                 
//SORTIN DD DSN=... input file                             
//ODD DD DSN=...  output file1 (odd records)                         
//EVEN DD DSN=...  output file2 (even records)                       
//SYSIN DD *                             
  SORT FIELDS=COPY                       
  OUTFIL FNAMES=(ODD,EVEN),SPLIT         
/*                                       
Back to top
View user's profile Send private message
i413678
Currently Banned

Active User


Joined: 19 Feb 2005
Posts: 112
Location: chennai

PostPosted: Fri Feb 03, 2006 2:18 pm    Post subject:
Reply with quote

Hi All,

Thank you one and all for promt reply.....

bye 4 now......

pavan
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


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