View previous topic :: View next topic
|
Author |
Message |
kalyan_lc5
New User
Joined: 06 Jul 2006 Posts: 9
|
|
|
|
Hi all,
here is my requirement.
i have one input file which have past month's data.
now i want to sort this file to have only last 7 days data from the current date of run.
i have used the syntax like this.
SORT FIELDS=COPY
INCLUDE COND=(1,4,PD,GE,DATE1P-7).
position 1 and length 4 is a date field in input file of format D.
but sort is not working and it is displaying the same data as in the input file.
kindly help me with some solution.
thank you |
|
Back to top |
|
|
senjay
Active User
Joined: 10 May 2007 Posts: 147 Location: India
|
|
|
|
Hi,
Use PD0 instead of PD. |
|
Back to top |
|
|
kalyan_lc5
New User
Joined: 06 Jul 2006 Posts: 9
|
|
|
|
i have used PD0,but getting an error in DATE1P.
is there any system variable to get the current date in JCL? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
You really do need to post the output from the run for any useful suggestions.
And I would also suggest using a meaningful title to your proble. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
As expat said you need to post sample input and required output.
As of now i feel that you should use DATE3P date format if you have four byte date in pd format. |
|
Back to top |
|
|
kalyan_lc5
New User
Joined: 06 Jul 2006 Posts: 9
|
|
|
|
below is the input file
input file
20080911
20080901
20080912
i want the output file as follows
20080911
20080912 |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
kalyan_lc5,
Your input date field has 8 digits and if it is a PD field, it occupies 5 bytes instead of 4 bytes.
Modifying the card as below should solve your problem.
Code: |
//SYSIN DD *
INCLUDE COND=(1,5,PD,GE,DATE1P-7)
SORT FIELDS=COPY
//* |
Thanks,
Arun |
|
Back to top |
|
|
karthikr44
Active User
Joined: 25 Aug 2007 Posts: 235 Location: Chennai
|
|
|
|
HI,
Kindly refer this,
Code: |
Format of Operand Format of Constant Example of Constant
DATE1P +yyyymmdd +20050621
DATE2P +yyyymm +200506
DATE3P +yyyyddd +2005172
|
Regards
R KARTHIK |
|
Back to top |
|
|
|