View previous topic :: View next topic
|
Author |
Message |
Singaiah
New User
Joined: 18 Nov 2008 Posts: 7 Location: Worcester
|
|
|
|
Hi,
Any one could you please help on the below criteria.
I have two files, one file is having the two dates and only one record.
Another file is having the 100000 records. Date is also one data field.
I want to read the records from the second file if the date is with in the date range, I want to write on to another file.
Please help me on this. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
show file layout of both files, including LRECL and RECFM.
Gerry |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Show an example of the records in each input file (relevant fields only) and what you expect for output. Give the RECFM and LRECL of the input files. Give the starting postion, length and format of each relevant field. |
|
Back to top |
|
|
Singaiah
New User
Joined: 18 Nov 2008 Posts: 7 Location: Worcester
|
|
|
|
The first input file layout is like -
20071026 20081025 80 Byte - VB Length file, First 8 bytes is date and one space next 8 bytes is date and next on wards space.
The second input file is like below - 80 byte VB length file - 40th byte on wards date filed is there.
Mike Newyork 20080522
Bill Chicago 20060522
Tom Boston 20090522
Edw Jersey 20071128
I need the output like below.
Mike Newyork 20080522
Edw Jersey 20071128 |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Singaiah,
The following DFSORT JCL will give you desired results
Code: |
//STEP0100 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=your single record 80 byte vb fle,DISP=SHR
//SORTOUT DD DSN=&&S1,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL VTOF,
BUILD=(C'LD,C''',5,8,C'''',/,C'HD,C''',14,8,C'''',80:X)
//*
//STEP0200 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=SHR
//SORTIN DD DSN=your 80 byte data file,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(40,8,CH,GE,LD,AND,40,8,CH,LE,HD)
/* |
|
|
Back to top |
|
|
Singaiah
New User
Joined: 18 Nov 2008 Posts: 7 Location: Worcester
|
|
|
|
Thank you very much. It's working fine. |
|
Back to top |
|
|
|