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
 

 

How to Split a file vertically using ICETOOL/DFSORT ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Rajan Moorthy
Warnings : 1

New User


Joined: 04 Jun 2007
Posts: 6
Location: Chennai

PostPosted: Wed Sep 26, 2007 5:21 pm    Post subject: How to Split a file vertically using ICETOOL/DFSORT ?
Reply with quote

My requirement is, how to split a file in to two files vertically based on the column. For Example,

INFILE1.(Rec length is 80)

Code:

CITY NAME IS NEWYORK        COUNTRY IS UNITED STATES
CITY NAME IS PARIS          COUNTRY IS FRANCE
CITY NAME IS MUMBAI         COUNTRY IS INDIA


OUTFILE1:

Code:

CITY NAME IS NEWYORK
CITY NAME IS PARIS
CITY NAME IS MUMBAI


OUTFILE2:

Code:

COUNTRY IS UNITED STATES
COUNTRY IS FRANCE
COUNTRY IS INDIA


Thanks,
Rajan Moorthy
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: Wed Sep 26, 2007 8:57 pm    Post subject:
Reply with quote

Rajan,

Here's a DFSORT job that will do what you asked for. I assumed the characters you want in output file1 start in input position 1 and the characters you want in output file2 start in input position 29, but the job can be changed appropriately for other layouts.

Code:

//S1    EXEC  PGM=ICEMAN                                     
//SYSOUT    DD  SYSOUT=*                                     
//SORTIN DD *                                                 
CITY NAME IS NEWYORK        COUNTRY IS UNITED STATES         
CITY NAME IS PARIS          COUNTRY IS FRANCE                 
CITY NAME IS MUMBAI         COUNTRY IS INDIA                 
/*
//OUT1 DD SYSOUT=*                                           
//OUT2 DD SYSOUT=*                                           
//SYSIN    DD    *                                           
  OPTION COPY                                                 
  OUTFIL FNAMES=OUT1,BUILD=(1,28,80:X)                       
  OUTFIL FNAMES=OUT2,BUILD=(29,28,80:X)                       
/*
Back to top
View user's profile Send private message
Rajan Moorthy
Warnings : 1

New User


Joined: 04 Jun 2007
Posts: 6
Location: Chennai

PostPosted: Fri Sep 28, 2007 6:04 pm    Post subject: Reply to: How to Split a file vertically using ICETOOL/DFSOR
Reply with quote

Thanks Frank, Its working
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 3 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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