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 depending on Day Difference

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

New User


Joined: 16 May 2005
Posts: 54

PostPosted: Fri Oct 26, 2012 5:27 am    Post subject: Split File depending on Day Difference
Reply with quote

Hi
I have a PS file having 100 LRECL and it is FB. The first 7 bytes contains julian date. I want to split the file into two depending upon the days diffrence. In file1, It will compare with system date and if day difference is equal to 1 will write it down else all will get into file2
Example
Suppose the system julian date is 2012299

And the input file is
2012297
2012299
2012298

the output
File1
2012298

File2
2012297
2012299
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7251

PostPosted: Fri Oct 26, 2012 6:13 am    Post subject: Reply to: Split File depending on Day Difference
Reply with quote

And the problem you have in achieving this is?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Oct 26, 2012 6:58 am    Post subject:
Reply with quote

what if the date in the file is 2012300?
Back to top
View user's profile Send private message
suzeet

New User


Joined: 16 May 2005
Posts: 54

PostPosted: Fri Oct 26, 2012 8:32 am    Post subject: Reply to: Split File depending on Day Difference
Reply with quote

If 2012300 then also it should go to file2
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Oct 26, 2012 9:47 am    Post subject:
Reply with quote

Hi,

it's Friday afternoon here and I'm in a good mood

try this
Code:
//STEP0100 EXEC PGM=SORT                                     
//SYSOUT   DD SYSOUT=*                                       
//SORTIN   DD *                                               
DUMMY RECORD                                                 
//SORTOUT  DD DSN=&&SYMBOLS,DISP=(,PASS,DELETE),UNIT=SYSDA,   
//            SPACE=(TRK,(1,1))                               
//SYSIN    DD *                                               
  SORT FIELDS=COPY                                           
  INREC BUILD=(DATE1-1)                                       
 OUTREC BUILD=(1,8,Y4T,TOJUL=Y4T)                             
 OUTFIL BUILD=(C'DAYBEFR,''',01,07,C'''',80:X)               
/*                                                           
//STEP0002 EXEC PGM=SORT                                     
//SYSOUT   DD SYSOUT=*                                       
//SYMNAMES DD DSN=&&SYMBOLS,DISP=SHR                         
//SYMNOUT  DD SYSOUT=*                                       
//SORTIN   DD *                                               
2012297                                                       
2012299                                                       
2012298                                                       
2012300                                         
2012301                                         
//DAY#BEFR DD SYSOUT=*                           
//ELSE     DD SYSOUT=*                           
//SYSIN    DD *                                 
  SORT FIELDS=COPY                               
  OUTFIL FNAMES=DAY#BEFR,                       
         INCLUDE=(01,07,CH,EQ,DAYBEFR)           
  OUTFIL FNAMES=ELSE,SAVE                       
/*



Gerry
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Difference between TWALENG and TWASIZE Arunkumar Chandrasekaran CICS 3 Tue Jan 03, 2017 12:57 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


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