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

Operation with 3 files


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sun_job

New User


Joined: 18 Sep 2007
Posts: 73
Location: Bangalore

PostPosted: Wed Oct 15, 2014 6:46 pm
Reply with quote

Appreciate all veterans help to solve the problem:

I have 3 files

File 1:
Code:
2014-10-15


File 2:

Code:

SSSS2014-10-15
WWW2014-10-16
AAAA2014-10-17
WWW2014-10-17
BBB2014-10-20


File 3:
Code:
2014-10-17


File 1 and File 3 will have start dates and end dates respectively.

Below is my desired output:
Code:

SSSS2014-10-15
WWW2014-10-16
AAAA2014-10-17
WWW2014-10-17


Basically in my output file , i should have those records which is fall in the start date (file 1 )and end date range (file 2).

This can be solved by a program, but it would be great if we can find a solution . using SORT

Thanks in advance
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: Wed Oct 15, 2014 7:23 pm
Reply with quote

Assuming that you File 1 and File 3 are suitable for contcatenation, one step to read those (start first, end second) and create a symbol/SYMNAMES file sourced with the appropriate value.

Then in the second step, where you process File 2, use the symbols.

Similar to examples here where one "date file" is required, it's just that you have two.
Back to top
View user's profile Send private message
sun_job

New User


Joined: 18 Sep 2007
Posts: 73
Location: Bangalore

PostPosted: Wed Oct 15, 2014 7:38 pm
Reply with quote

Bill Woodger wrote:
Assuming that you File 1 and File 3 are suitable for contcatenation, one step to read those (start first, end second) and create a symbol/SYMNAMES file sourced with the appropriate value.

Then in the second step, where you process File 2, use the symbols.

Similar to examples here where one "date file" is required, it's just that you have two.


Thanks Bill, could you please give me the link of the examples you mentioned
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: Wed Oct 15, 2014 7:56 pm
Reply with quote

If you click on DFSORT/ICETOOL immediately above, you'll be taken to that particular forum. There is a Search box. I put "symbols" in and about the fourth result was this.

Follow the links to encounter a post by mistah kurtz.
Back to top
View user's profile Send private message
sun_job

New User


Joined: 18 Sep 2007
Posts: 73
Location: Bangalore

PostPosted: Wed Oct 15, 2014 7:59 pm
Reply with quote

Bill Woodger wrote:
If you click on DFSORT/ICETOOL immediately above, you'll be taken to that particular forum. There is a Search box. I put "symbols" in and about the fourth result was this.

Follow the links to encounter a post by mistah kurtz.


Thanks a lot
Back to top
View user's profile Send private message
Gabriel Araujo Alves

New User


Joined: 20 Jul 2010
Posts: 38
Location: Brazil

PostPosted: Thu Oct 16, 2014 2:21 am
Reply with quote

sun_job,

i tried this, but it is missing the last record. Sorry but i have no more time to think about. Hope it helps. I am concatenating the first ans last file in the Sortin.

Code:

//*********************************************************************
//STEP1       EXEC PGM=SORT                                           
//SYSOUT      DD SYSOUT=*                                             
//SYSPRINT    DD SYSOUT=*                                             
//SORTIN      DD *                                                     
2014-10-15                                                             
2014-10-17                                                             
//SORTOUT     DD DSN=&&TEMP,UNIT=VIO,DISP=(,CATLG)                     
//SYSIN       DD *                                                     
 SORT FIELDS=COPY                                                     
 OUTFIL REMOVECC,NODETAIL,                                             
   TRAILER1=(C' SORT FIELDS=(COPY) ',/,                               
   C' INREC IFTHEN=(WHEN=GROUP,',/,                                   
   C' BEGIN=(5,10,UFF,EQ,',MIN(01,10,UFF,TO=ZD,LENGTH=08),C'),',/,     
   C' PUSH=(30:ID=1), ',/,                                             
   C' END=(5,10,UFF,EQ,',MAX(01,10,UFF,TO=ZD,LENGTH=08),C'))',/,       
   C' OUTFIL INCLUDE=(30,01,ZD,EQ,1),BUILD=(01,14)')                   
/*                                                                     
//*********************************************************************
//STEP2       EXEC PGM=SORT                                           
//SYSOUT      DD SYSOUT=*                                             
//SYSPRINT    DD SYSOUT=*                                             
//SORTIN      DD *                                                     
SSSS2014-10-15                                                         
WWW2014-10-16                                                         
AAAA2014-10-17                                                         
WWW2014-10-17                                                         
BBB2014-10-20                                                         
//SORTOUT     DD SYSOUT=*                                             
//SYSIN       DD DSN=*.STEP1.SORTOUT,DISP=(SHR)                       
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 0
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
Search our Forums:

Back to Top