View previous topic :: View next topic
|
Author |
Message |
sakthi_ksv
New User
Joined: 20 Jul 2006 Posts: 48 Location: Chennai
|
|
|
|
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 |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
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 |
|
|
sakthi_ksv
New User
Joined: 20 Jul 2006 Posts: 48 Location: Chennai
|
|
|
|
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 |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
Back to top |
|
|
sakthi_ksv
New User
Joined: 20 Jul 2006 Posts: 48 Location: Chennai
|
|
|
|
Could you please give me the actual sort card for this? |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
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:
|
|
Back to top |
|
|
sakthi_ksv
New User
Joined: 20 Jul 2006 Posts: 48 Location: Chennai
|
|
|
|
Thanks a lot Murali.
Thanks for the timely help. |
|
Back to top |
|
|
sakthi_ksv
New User
Joined: 20 Jul 2006 Posts: 48 Location: Chennai
|
|
|
|
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 |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Sakthivel,
I tried your sortcard. Its working fine for me. |
|
Back to top |
|
|
sakthi_ksv
New User
Joined: 20 Jul 2006 Posts: 48 Location: Chennai
|
|
|
|
Do you know why it is giving error for me??? Is anything has to be done with the setting |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
|