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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Split file FILE-A into FILE-1 & FILE-2
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 Moderator


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

PostPosted: Tue Feb 15, 2011 3:42 am    Post subject:
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    Post subject: Reply to: Split file FILE-A into FILE-1 & FILE-2
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    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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


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