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

Need help in sorting


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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
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
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 Developer


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

PostPosted: Sat Jul 23, 2005 5:57 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
This topic is locked: you cannot edit posts or make replies. Automation need help in sorting the data DFSORT/ICETOOL 38
No new posts Sorting a record spanned over multipl... DFSORT/ICETOOL 13
No new posts Creating additional seqnum/Literal wh... DFSORT/ICETOOL 4
No new posts ICETOOL Sorting and Discarding DUPS SYNCSORT 11
No new posts Sorting on text - but in non-alphabet... SYNCSORT 5
Search our Forums:

Back to Top