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 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: 7315

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: 6968
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 Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm

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