MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
Robo2005 Beginner Joined: 13 Jul 2005 Posts: 11 Topics: 3
Posted: Wed Jul 13, 2005 12:25 pm Post subject: How to get one month old data?
Hi,
Please help me in finding the solution for the following requirement.
I have one file having 80 bytes lengh.
Field1 - 1,9
create-date - 12,8 (date is in 9s complement)
field2 - 20,10
Now requirement is to extract previous month data.
That is if I run this month(july), i shld extract only june data.
I want to do thru SORT.
Thanks
Robo.
Back to top
Alain Benveniste Beginner Joined: 04 May 2003 Posts: 92 Topics: 4 Location: Paris, France
Posted: Wed Jul 13, 2005 1:16 pm Post subject:
How the create-date look like ?
What 'date is in 9s complement' means ?
Alain
Back to top
Robo2005 Beginner Joined: 13 Jul 2005 Posts: 11 Topics: 3
Posted: Wed Jul 13, 2005 1:27 pm Post subject:
Alain,
Sorry for not giving enough information.
create date looks like ccyymmdd
and 9s complement means for example
todays date(20050713) will be stored like 79949286
(99999999 - 20050713) in file.
Thanks
Robo
Back to top
Alain Benveniste Beginner Joined: 04 May 2003 Posts: 92 Topics: 4 Location: Paris, France
Posted: Wed Jul 13, 2005 2:08 pm Post subject:
Robo,
And how do you want your input to look like : can you give multi input/output examples.
What sense has substracting 999999999 to a ccyymmdd. Just curious.
Alain
Back to top
Robo2005 Beginner Joined: 13 Jul 2005 Posts: 11 Topics: 3
Posted: Wed Jul 13, 2005 3:02 pm Post subject:
Yes, I can get multiple i/ps.
The i/p looks like
Code:
111111111 79949898AAAAAAAAAA
222222222 79949798BBBBBBBBBB
333333333 79949698CCCCCCCCCC
444444444 79949598DDDDDDDDDD
555555555 79949588EEEEEEEEEE
666666666 79949388EEEEEEEEEE
777777777 79949388EEEEEEEEEE
If I run in May month,
o/p shld be
Code:
444444444 79949598DDDDDDDDDD
555555555 79949588EEEEEEEEEE
If I run in July month,
o/p shld be
Code:
666666666 79949388EEEEEEEEEE
777777777 79949388EEEEEEEEEE
Thanks
Rovbo.
Back to top
Alain Benveniste Beginner Joined: 04 May 2003 Posts: 92 Topics: 4 Location: Paris, France
Posted: Thu Jul 14, 2005 8:39 am Post subject:
Here is the DFSORT/ICETOOL jcl.
2nd IFTHEN is for january : if mm = 01 then mm = 12 & 1 is substracted to yyyy.
The test in the INCLUDE is made on the year & the month.
Code:
//STEP0001 EXEC PGM=ICETOOL
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN) USING(ICE0)
/*
//IN DD *
111111111 79949898AAAAAAAAAA
222222222 79949798BBBBBBBBBB
333333333 79949698CCCCCCCCCC
444444444 79949598DDDDDDDDDD
555555555 79949588EEEEEEEEEE
666666666 79949388EEEEEEEEEE
777777777 79949388EEEEEEEEEE
/*
//OUTX DD SYSOUT=*
//ICE0CNTL DD *
INREC IFTHEN=(WHEN=INIT,
OVERLAY=(81:+99999999,SUB,12,8,ZD,M11,LENGTH=8,DATE2)),
IFTHEN=(WHEN=(93,2,CH,EQ,C'01'),
OVERLAY=(89:89,4,ZD,SUB,+1,M11,LENGTH=4,
93:C'12')),
IFTHEN=(WHEN=NONE,
OVERLAY=(93:93,2,ZD,SUB,+1,M11,LENGTH=2))
OUTFIL FNAMES=OUTX,
INCLUDE=(81,6,ZD,EQ,89,6,ZD),
BUILD=(1,80)
/*
Alain
Back to top
Robo2005 Beginner Joined: 13 Jul 2005 Posts: 11 Topics: 3
Posted: Wed Jul 20, 2005 3:05 pm Post subject:
Hi Alain,
Today only I came from vacation.
It worked fine with little modifications. Thank you verymuch Alain.
Thanks
Robo
Back to top
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