View previous topic :: View next topic
|
Author |
Message |
Mariraj
New User
Joined: 09 Jul 2007 Posts: 59 Location: Chennai
|
|
|
|
Hi,
I need to sort a file which contains XML records using DFSORT. The record contains a tag like <CRTS>2012-09-26-01.01.01.000000</CRTS>. I need to sort and filter records based on this timestamp value. Being an XML, the position of this <CRTS> tag keeps varying.
Input file Specifications
RECFM=FB, LRECL=80
Sample data:
Code: |
AAAAAAAAAAA<CRTS>2012-09-26-02.01.01.000000</CRTS>BBBBBBBBBBBB
XXXXXXXX<CRTS>2012-09-26-01.01.01.000000</CRTS>HHHHHHHHHHHHH
CCCCCCC<CRTS>2012-02-26-03.01.01.000000</CRTS>BBBBBBBBB |
I need to include only records which are within 90 days from current date.
Please let me know how this can be done. If there is a similar post which has already been answered, please let me know. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Unlike the other forum SYNCSORT queries go into the JCL forum here. PLease familiarise yourself with the forum sections and rules before using. |
|
Back to top |
|
|
Mariraj
New User
Joined: 09 Jul 2007 Posts: 59 Location: Chennai
|
|
|
|
How did you concluded that I am asking about SYNCSORT when I have clearly mentioned that I am looking for solution using DFSORT. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
How did you concluded that I am asking about SYNCSORT when I have clearly mentioned that I am looking for solution using DFSORT. |
because You posted Your question in the JCL forum, where SYNCSORT questions are handled
and because most of the people asking <sort> questions confuse the two products |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
How did you concluded that I am asking about SYNCSORT when I have clearly mentioned that I am looking for solution using DFSORT. |
Many (most) of the sort questions begin life in the DFSORT part of the forum. Many Syncsort users do not even know they are Not using DFSORT. Others do know and try to sneak their question into the DFSORT part of the forum because we have an IBM developer who provides excellent solutions and often it is not obvious that a question is for one sort product or aonther.
As your topic was posted in the JCL part of the forum and you have been a member for more than 5 years, it was rather logical to believe the DFSORT might have been a typo. . . |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Mariraj,
Use the following DFSORT JCL which will give you the desired results.
Code: |
//SYSIN DD *
INREC PARSE=(%01=(STARTAFT=C'<CRTS>',FIXLEN=10)),OVERLAY=(81:%01)
SORT FIELDS=COPY
OUTFIL BUILD=(1,80),INCLUDE=(81,10,CH,GT,DATE1(-)-90)
//* |
|
|
Back to top |
|
|
Mariraj
New User
Joined: 09 Jul 2007 Posts: 59 Location: Chennai
|
|
|
|
Kolusu, thanks for the posting the solution. I was able to do it myself with some direction from Enrico.
Thanks for the guidance everyone. |
|
Back to top |
|
|
|