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
 

 

Read data if the date is with in the date range

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Read data if the date is with in the date range
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: 1703
Location: Australia

PostPosted: Thu Nov 20, 2008 6:02 am    Post subject:
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 Moderator


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

PostPosted: Thu Nov 20, 2008 6:03 am    Post subject:
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    Post subject:
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    Post subject: Reply to: Read data if the date is with in the date range
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    Post subject:
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    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 Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm


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