Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Sorting a file based on timestamp

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
sakthi_ksv

New User


Joined: 20 Jul 2006
Posts: 48
Location: Chennai

PostPosted: Tue Oct 09, 2007 2:44 pm    Post subject: Sorting a file based on timestamp
Reply with quote

I have a file with several fields along with a timestamp. I want to sort this file based on time stamp. How can I code the sort card for this?

Also another requirement for me is I want to copy only one field in the above file based on the timestamp. ie If the file has the record for one month I want only the first 5 bytes to be copied to another file which are written in the file in the last seven days. How can I put the sort card to check the time stamp for this.

Sakthivel
Back to top
View user's profile Send private message

murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Tue Oct 09, 2007 2:48 pm    Post subject:
Reply with quote

Sakthivel,

Could you post your sample IP and OP?

Quote:
Does sort card understands the LT and GT for date

It does understand LT/GT conditions.
Back to top
View user's profile Send private message
sakthi_ksv

New User


Joined: 20 Jul 2006
Posts: 48
Location: Chennai

PostPosted: Tue Oct 09, 2007 3:09 pm    Post subject:
Reply with quote

Ok leave all the things, Just have this question. I have file with a sample record as follows

12345<SPACE>2007-10-09-10.02.59.220587


I want to copy first 5 bytes of the records from this file to another file based on date between oct-02-2007 to oct-09-2007.

can I put the sort card as GT 2007-10-02 AND LT 2007-10-09.
will it work?

Sakthivel.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Tue Oct 09, 2007 3:20 pm    Post subject:
Reply with quote

Do you need a a pointer to a sort manual?
Back to top
View user's profile Send private message
sakthi_ksv

New User


Joined: 20 Jul 2006
Posts: 48
Location: Chennai

PostPosted: Tue Oct 09, 2007 3:22 pm    Post subject:
Reply with quote

Could you please give me the actual sort card for this?
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Tue Oct 09, 2007 3:38 pm    Post subject:
Reply with quote

Sakthi,

Use the topic INCLUDE RECORDS USING RELATIVE DATES topic from the sorttrck pdf available under the link -

http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Tue Oct 09, 2007 3:45 pm    Post subject:
Reply with quote

Sakthi,

Ignore my prev post. Here is the sosrtcard for your req -

Code:
//SORTIN DD *                                     
12345 2007-10-10                                 
12345 2007-10-09                                 
34345 2007-10-08                                 
12556 2007-10-02                                 
12AB6 2007-10-01                                 
/*                                               
//SORTOUT DD SYSOUT=*                             
//SYSIN DD *                                     
  OPTION COPY                                     
  INCLUDE COND=(7,10,CH,LE,C'2007-10-09',AND,     
                7,10,CH,GE,C'2007-10-02')         
  OUTREC FIELDS=(1,5)                             
/*                                               


OP:

Code:
12345   
34345   
12556   
Back to top
View user's profile Send private message
sakthi_ksv

New User


Joined: 20 Jul 2006
Posts: 48
Location: Chennai

PostPosted: Tue Oct 09, 2007 5:59 pm    Post subject:
Reply with quote

Thanks a lot Murali.

Thanks for the timely help.
Back to top
View user's profile Send private message
sakthi_ksv

New User


Joined: 20 Jul 2006
Posts: 48
Location: Chennai

PostPosted: Thu Oct 11, 2007 10:11 am    Post subject:
Reply with quote

Hi I used the sort card as follows to remove the record that are older than 7 seven days. But it is giving an error
Code:

OPTION DYNALLOC=(SYSDA,9),FILSZ=E100000
SORT FIELDS=COPY                       
INCLUDE COND=(18,10,CH,GT,DATE1(-)-7)   

ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED                                 
ICE000I 1 - CONTROL STATEMENTS FOR 5740-SM1, DFSORT REL 14.0 - 05:24 ON THU OCT
             OPTION DYNALLOC=(SYSDA,9),FILSZ=E100000                           
             SORT FIELDS=COPY                                                   
             INCLUDE COND=(18,10,CH,GT,DATE1(-)-7)                             
                                               $                               
ICE007A E SYNTAX ERROR                                                         


I used this as said the DFS sort tricks PDF. But it is giving an error. Please help me on this. Is there anything to be done with the sort technique selected or is there any other way to accomplish this requirement??


Thanks and Regards,
Sakthi
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Thu Oct 11, 2007 11:13 am    Post subject:
Reply with quote

Sakthivel,

I tried your sortcard. Its working fine for me.
Back to top
View user's profile Send private message
sakthi_ksv

New User


Joined: 20 Jul 2006
Posts: 48
Location: Chennai

PostPosted: Thu Oct 11, 2007 11:36 am    Post subject:
Reply with quote

Do you know why it is giving error for me??? Is anything has to be done with the setting
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 Oct 11, 2007 9:28 pm    Post subject:
Reply with quote

Sakthi,

Your control statements are ok. However, the syntax error indicates that you don't have DFSORT R14 PTF UK90006 (April, 2006) installed. You need that PTF to use relative dates. Ask your System Programmer to install that PTF (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTF, see:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/
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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts How to insert a value on specific pos... Poha Eater DFSORT/ICETOOL 9 Sun Oct 01, 2017 3:04 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us