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
 
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: 8657
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: 2353
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 3270 Data stream error Benchwarmer CICS 6 Tue Apr 17, 2018 12:06 am
No new posts How to list data set names with diffe... murali.andaluri CLIST & REXX 8 Thu Apr 12, 2018 11:33 pm
No new posts Reformatting and adding additional fi... Badbeef SYNCSORT 6 Thu Apr 05, 2018 4:45 pm
No new posts Invalid XML character while producing... nikhil.bhole IBM Tools 4 Tue Mar 20, 2018 1:24 am
No new posts Get the list of data sets on DASD and... rakaitn JCL & VSAM 3 Thu Mar 08, 2018 12:38 pm

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