MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

select records where timestamp matches current year

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
shuko
Beginner


Joined: 08 Nov 2005
Posts: 73
Topics: 20

PostPosted: Tue Jul 03, 2007 6:39 am    Post subject: select records where timestamp matches current year Reply with quote

I have a file with FB and LRECL=2562. I have a timestamp starting at position 1891. I would like to select only timestamp which matches the
current year from this file and write to another file.
At the moment I do it like this, with the year hard coded. Is it possible
to say for example CURRENT YEAR instead of hard coding?


Code:

OUTFIL FNAMES=OUT,                         
  INCLUDE=(1891,4,CH,EQ,C'2007'),   
  OUTREC=(1,2562)                     
   
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Tue Jul 03, 2007 6:49 am    Post subject: Reply with quote

shuko,

Use Date1 parm to put the current date(YYYYMMDD) at the end of each record and now compare the contents at 1891 to the date at the end of the record.

Try this

Code:

//SYSIN    DD *                           
  SORT FIELDS=COPY                       
  OUTREC OVERLAY=(2563:DATE1)             
  OUTFIL INCLUDE=(1891,4,CH,EQ,2563,4,CH),
  OUTREC=(1,2562)                         
/*   


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue Jul 03, 2007 10:10 am    Post subject: Reply with quote

Here's a better way to do it using DFSORT's new System Symbol String Constants (S'string') feature. You'll need z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) to use this new feature. If you don't have the April, 2006 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTF, see:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/

Code:

//S1    EXEC  PGM=ICEMAN                 
//SYSOUT    DD  SYSOUT=*                 
//SYMNAMES DD *                           
CURYR,S'&YR4.'                           
//SORTIN DD DSN=...  input file     
//SORTOUT DD DSN=...  output file             
//SYSIN    DD    *                       
  OPTION COPY                             
  INCLUDE COND=(1891,4,CH,EQ,CURYR)
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
shuko
Beginner


Joined: 08 Nov 2005
Posts: 73
Topics: 20

PostPosted: Wed Jul 04, 2007 12:39 am    Post subject: Reply with quote

Thank you Kolusu,Frank. Both the codes worked for me.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group