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

Read data if the date is with in the date range


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

New User


Joined: 18 Nov 2008
Posts: 7
Location: Worcester

PostPosted: Thu Nov 20, 2008 4:55 am
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Nov 20, 2008 6:02 am
Reply with quote

Hi,

show file layout of both files, including LRECL and RECFM.


Gerry
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Nov 20, 2008 6:03 am
Reply with quote

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
View user's profile Send private message
Singaiah

New User


Joined: 18 Nov 2008
Posts: 7
Location: Worcester

PostPosted: Thu Nov 20, 2008 9:55 pm
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Nov 20, 2008 10:20 pm
Reply with quote

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
View user's profile Send private message
Singaiah

New User


Joined: 18 Nov 2008
Posts: 7
Location: Worcester

PostPosted: Sat Nov 22, 2008 1:16 am
Reply with quote

Thank you very much. It's working fine.
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 Error to read log with rexx CLIST & REXX 11
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
Search our Forums:

Back to Top