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 

Sort after comparision and manipulation with current year

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


Joined: 22 Sep 2005
Posts: 11
Topics: 5
Location: WI,US

PostPosted: Mon Dec 31, 2007 3:53 pm    Post subject: Sort after comparision and manipulation with current year Reply with quote

Hi,

I have a fixed block input file which is of length 117 and on position 54, there is a year field. This field can have the current year, or current year+1 , or current year+2.

I have a requirement to split the input file in a single step to 3 different files based on the value of the year field on position 54.

I have gone through the other related posts which explains DATE1 and DATE3 parameters, but could not figure out how to compare the field with only the year-part and do the manipulation. Also, if I do with SYMNAMES, then I need to change it every year. So, I am trying to avoid any manual inntervention every year.

Can you please help me achieving this requirement,
Thanks,
Pranabesh
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Mon Dec 31, 2007 7:07 pm    Post subject: Reply with quote

Here's a DFSORT job that will do what you asked for. It will create the correct Symbols for the three years automatically based on the current year (e.g. 2007 today, 2008 tomorrow).

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
RECORD
/*
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
  INREC BUILD=(DATE2)
  OUTFIL BUILD=(C'YR1,+',1,4,80:X,/,
    C'YR2,+',1,4,ZD,ADD,+1,TO=ZD,LENGTH=4,/,
    C'YR3,+',1,4,ZD,ADD,+2,TO=ZD,LENGTH=4)
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=...  input file
//OUT1 DD DSN=...  ouput file1 (current year)
//OUT2 DD DSN=...  ouput file1+1 (current year+1)
//OUT3 DD DSN=...  ouput file1+2 (current year+2)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL FNAMES=OUT1,INCLUDE=(54,4,ZD,EQ,YR1)
  OUTFIL FNAMES=OUT2,INCLUDE=(54,4,ZD,EQ,YR2)
  OUTFIL FNAMES=OUT3,INCLUDE=(54,4,ZD,EQ,YR3)
/*

_________________
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
Pranabesh
Beginner


Joined: 22 Sep 2005
Posts: 11
Topics: 5
Location: WI,US

PostPosted: Mon Jan 07, 2008 7:56 pm    Post subject: Reply with quote

Thanks much Frank!!
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