|
View previous topic :: View next topic
|
| Author |
Message |
sun_job
New User

Joined: 18 Sep 2007 Posts: 73 Location: Bangalore
|
|
|
|
Appreciate all veterans help to solve the problem:
I have 3 files
File 1:
File 2:
| Code: |
SSSS2014-10-15
WWW2014-10-16
AAAA2014-10-17
WWW2014-10-17
BBB2014-10-20
|
File 3:
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 |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
 |
sun_job
New User

Joined: 18 Sep 2007 Posts: 73 Location: Bangalore
|
|
|
|
| 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 |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
 |
sun_job
New User

Joined: 18 Sep 2007 Posts: 73 Location: Bangalore
|
|
|
|
| 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 |
|
 |
Gabriel Araujo Alves
New User
Joined: 20 Jul 2010 Posts: 38 Location: Brazil
|
|
|
|
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 |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|