Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm
No new posts unable to set RC = 4 when empty file migusd SYNCSORT 1 Tue Nov 21, 2017 1:21 am
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us