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
 

 

Need help in sorting

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
ankursanghi

New User


Joined: 19 Jul 2005
Posts: 4

PostPosted: Tue Jul 19, 2005 2:06 pm    Post subject: Need help in sorting
Reply with quote

Hi all,

I am new to this forum. So, please guide me if I am making any mistakes in posting this query here.

Here is my problem:
The input flat file contains two date fields (both in display format).

My requirement is to filter the flat file such that the output file contains only records where first date is less than second date.

Is it possible to do it using SORT? Otherwise please suggest any other way like using Compare tool or File Aid... I need this asap... please help.
Back to top
View user's profile Send private message

KAUSHIK RANGARAJAN

New User


Joined: 19 Jul 2005
Posts: 22
Location: chennai

PostPosted: Tue Jul 19, 2005 3:06 pm    Post subject: RE: Need help in sorting
Reply with quote

HI,

This might help.

Here is the code.

SORT FIELDS=(1,4,CH,A)
INCLUDE COND=(25,10,CH,LT,55,10,CH)


1,4 is primary key based on which sorting is done. This U will be knowing.

Now for that compare condition:
25,10 is the first date location. 55,10 is the second location.
CH is the format.
LT will check for the difference in dates, only those matching the condition will be selected.

Bye.
icon_rolleyes.gif icon_smile.gif
Back to top
View user's profile Send private message
pushpagiri

New User


Joined: 07 Jul 2005
Posts: 51

PostPosted: Tue Jul 19, 2005 3:35 pm    Post subject:
Reply with quote

hi,
This wil work.Try it And let me know if i am
wrong anywhere.

input.ps:

20050716 20050718
20050716 20050719
20050716 20050714
20050716 20050715



jcl:

//STEP1 EXEC PGM=SORT
//SORTIN DD DSN=input.PS,DISP=SHR
//SORTOUT DD DSN=output.PS,DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,8,CH,A)
INCLUDE COND=(1,8,CH,LE,10,8,CH)
/*



Regards,
Push
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: Sat Jul 23, 2005 5:57 am    Post subject:
Reply with quote

You don't need to do a SORT to do this - you can just do a COPY. And LT (less than) is the correct comparison operator for the stated requirement, not LE (less than or equal to). The DFSORT job would be:

Code:

//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN DD *
   OPTION COPY
   INCLUDE COND=(1,8,CH,LT,10,8,CH)
/*
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Sorting of hex values Saurabh_mi DFSORT/ICETOOL 10 Thu May 25, 2017 3:49 pm
No new posts Sorting group data rajella DFSORT/ICETOOL 4 Sun Jan 22, 2017 11:32 pm
No new posts Efficient sorting chandracdac DFSORT/ICETOOL 5 Sat Oct 22, 2016 3:23 am
No new posts Stripping and Sorting of VB file G SRINIVASA RAO SYNCSORT 5 Wed Sep 14, 2016 1:34 pm
No new posts DFSORT sorting only specific records akodakka DFSORT/ICETOOL 4 Thu Aug 04, 2016 11:24 am


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