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
 

 

How to sort the below using DFSORT?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: How to sort the below using DFSORT?
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    Post subject: Reply to: How to sort the below using DFSORT?
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 Moderator


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

PostPosted: Thu May 15, 2008 8:48 pm    Post subject:
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    Post subject: Reply to: How to sort the below using DFSORT?
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: 205
Location: Bangalore

PostPosted: Fri May 16, 2008 9:58 pm    Post subject:
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    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 Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am


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