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

Split file FILE-A into FILE-1 & FILE-2


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
subbu1522

New User


Joined: 11 Sep 2008
Posts: 29
Location: USA

PostPosted: Tue Feb 15, 2011 3:22 am
Reply with quote

I have a FB FILE-A of 422 byte length, which needs to be split into 2 files.

File-1:
INCLUDE

IF POS-58 = '5' AND POS-121-122 NOT= 42 and POS-121-122 NOT= 45 AND DATE GREATER THAN 10/14/2010 (mm/dd/yyyy is the format in the FILE-A)

OR

IF POS-58 = 'S' AND DATE GREATER THAN 10/14/2010 (mm/dd/yyyy is the format in the FILE-A)

ELSE
write to FILE-2:


Could some one please help me.
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: Tue Feb 15, 2011 3:42 am
Reply with quote

Assuming your date in FILE-A is really mmddyyyy in positions 32-39 as stated in your other post, here's a DFSORT job that will do what you asked for. If your date is really something else or somewhere else, adjust accordingly, or give me the details and I'll show you how to change the job.

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file (FB/422)
//OUT1 DD DSN=...  output file1 (FB/422)
//OUT2 DD DSN=...  output file2 (FB/422)
//SYSIN DD *
 INREC OVERLAY=(423:36,4,32,4)                             
  OPTION COPY                                               
  OUTFIL FNAMES=OUT1,INCLUDE=((58,1,CH,EQ,C'5',AND,         
    121,2,CH,NE,C'42',AND,121,2,CH,NE,C'45',AND,           
    423,8,CH,GT,C'20101014'),OR,                           
   (58,1,CH,EQ,C'S',AND,                                   
    423,8,CH,GT,C'20101014')),BUILD=(1,422)                 
  OUTFIL FNAMES=OUT2,SAVE                                   
/*
Back to top
View user's profile Send private message
subbu1522

New User


Joined: 11 Sep 2008
Posts: 29
Location: USA

PostPosted: Tue Feb 15, 2011 4:12 am
Reply with quote

Hi Frank, thanks for your quick help. Yes, my date format is really mmddyyyy fermat. Looks like the code that you gave is getting me the good results.

Thanks.
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 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
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top