IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to Split a file vertically using ICETOOL/DFSORT ?


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Rajan Moorthy
Warnings : 1

New User


Joined: 04 Jun 2007
Posts: 11
Location: Chennai

PostPosted: Wed Sep 26, 2007 5:21 pm
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 Developer


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

PostPosted: Wed Sep 26, 2007 8:57 pm
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: 11
Location: Chennai

PostPosted: Fri Sep 28, 2007 6:04 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top