Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
SYNCSORT to have only last 7 days data

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL
Author Message
kalyan_lc5

New User


Joined: 06 Jul 2006
Posts: 3

PostPosted: Fri Sep 12, 2008 12:12 pm    Post subject: SYNCSORT to have only last 7 days data
Reply with quote

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
View user's profile Send private message
References
senjay

Active User


Joined: 10 May 2007
Posts: 85
Location: India

PostPosted: Fri Sep 12, 2008 12:20 pm    Post subject: Reply to: JCL
Reply with quote

Hi,
Use PD0 instead of PD.
Back to top
View user's profile Send private message
kalyan_lc5

New User


Joined: 06 Jul 2006
Posts: 3

PostPosted: Fri Sep 12, 2008 12:59 pm    Post subject: Reply to: JCL
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 3563
Location: Brussels once more ...

PostPosted: Fri Sep 12, 2008 1:02 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Sambhaji
Warnings : 1

Active User


Joined: 16 Feb 2007
Posts: 267
Location: Pune, India

PostPosted: Fri Sep 12, 2008 2:54 pm    Post subject:
Reply with quote

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
View user's profile Send private message
kalyan_lc5

New User


Joined: 06 Jul 2006
Posts: 3

PostPosted: Fri Sep 12, 2008 6:46 pm    Post subject: Reply to: SYNCSORT to have only last 7 days data
Reply with quote

below is the input file

input file

20080911
20080901
20080912

i want the output file as follows

20080911
20080912
Back to top
View user's profile Send private message
arcvns

Senior Member


Joined: 17 Oct 2006
Posts: 800
Location: Chennai, India

PostPosted: Mon Sep 15, 2008 12:59 pm    Post subject:
Reply with quote

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
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 172
Location: Chennai

PostPosted: Mon Sep 15, 2008 2:32 pm    Post subject: Reply to: SYNCSORT to have only last 7 days data
Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL All times are GMT + 6 Hours
Page 1 of 1