Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search 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
Author Message
itjagadesh

New User


Joined: 05 Dec 2006
Posts: 36
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
References
itjagadesh

New User


Joined: 05 Dec 2006
Posts: 36
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: 4607
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: 36
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: 125
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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1