Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ 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 & VSAM
View previous topic :: :: View next topic  
Author Message
kalyan_lc5

New User


Joined: 06 Jul 2006
Posts: 9

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

senjay

Active User


Joined: 10 May 2007
Posts: 147
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: 9

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: 8593
Location: Back in jolly old England

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
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

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: 9

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
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2180
Location: @my desk

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: 235
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Sorting group data rajella DFSORT/ICETOOL 3 Sun Jan 22, 2017 11:32 pm
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 5 Sat Jan 21, 2017 4:02 am
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 1 Mon Jan 02, 2017 11:16 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us