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

How to sort the below using DFSORT?


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

New User


Joined: 05 Dec 2006
Posts: 89
Location: chennai

PostPosted: Thu May 15, 2008 3:38 pm
Reply with quote

Hi All,
I Need a requirement like below

Input PS File1 RECFM = 80 contains one record(Timestamp)

Code:

2008


Input PS File2 RECFM = 80 (Customer and timestamp)

Code:

100   2005
101   2006
102   2007
103   2008
104   2009
105   2010
108   2011


File1 contains Time stamp and File2 Contains Customer ,Timestamp
Output PS File3 RECFM = 80 should contains timestamp greater than or equal to 2008..like below.. (Key as first file)

Code:

103   2008
104   2009
105   2010
108   2011

Please help me to sort out this
Regards
Jagadesh
Back to top
View user's profile Send private message
itjagadesh

New User


Joined: 05 Dec 2006
Posts: 89
Location: chennai

PostPosted: Thu May 15, 2008 3:49 pm
Reply with quote

In the above requirement ,
PS File1 - Data may vary dynamically (Timestamp will vary)
For Example I given as 2008.

Regards
Jagadesh
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 May 15, 2008 8:48 pm
Reply with quote

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file1 - timestamp (FB/80)
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
* Create DFSORT symbol as:
* TDATE,+yyyy
  INREC BUILD=(C'TDATE,+',1,4,80:X)
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD *
//SORTIN DD DSN=...  input file2 - customer/timestamp (FB/80)
//SORTOUT DD DSN=...  output file - customer/timestamp (FB/80)
//SYSIN    DD    *
  OPTION COPY
* Use TDATE in INCLUDE
  INCLUDE COND=(7,4,ZD,GE,TDATE)
/*
Back to top
View user's profile Send private message
itjagadesh

New User


Joined: 05 Dec 2006
Posts: 89
Location: chennai

PostPosted: Fri May 16, 2008 9:39 am
Reply with quote

Thanks a lot Frank,

Its working fine.

Thanks
Jagadesh
Back to top
View user's profile Send private message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 206
Location: Bangalore

PostPosted: Fri May 16, 2008 9:58 pm
Reply with quote

Good example on how to create SYMNAMES dataset.

Thanks Franks.
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 Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top