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

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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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