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

Split File depending on Day Difference


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Oct 26, 2012 6:13 am
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
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
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: 1702
Location: Australia

PostPosted: Fri Oct 26, 2012 9:47 am
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 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 4
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