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
 

 

Reg:DFSORT/ICETOOL.....itz Urgent....

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
ykishore

New User


Joined: 12 Aug 2005
Posts: 53
Location: USA

PostPosted: Mon Aug 29, 2005 6:36 pm    Post subject: Reg:DFSORT/ICETOOL.....itz Urgent....
Reply with quote

HI

Here is my requirement ...

i've a sequential file....which has following contents..

123kishore 20050910-----(ccyymmdd)
123kishore 20051030
111sachin 19980121
111sachin 19991030

i want the output as below:
-----------------------------------
123kishore 20051030
111sachin 19991030

i want the latest record from the above input.

please provide me the jcl for the same ...
Back to top
View user's profile Send private message

ykishore

New User


Joined: 12 Aug 2005
Posts: 53
Location: USA

PostPosted: Mon Aug 29, 2005 6:45 pm    Post subject:
Reply with quote

HI

Here is my requirement ...

i've a sequential file....which has following contents..

123kishore 20050910-----(ccyymmdd...Valuation date)
123kishore 20051030
111sachin 19980121
111sachin 19991230



among the above input ,the output should have the latest valuation date.and also we suppose to add 1 month to the Month part .for eg:

123kishore 20051010---(after adding 1 month to the month part)
111sachin 20000130---(---------do---------------------------icon_cool.gif

please provide me the JCL for the same......
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Mon Aug 29, 2005 8:18 pm    Post subject: Re: Reg:DFSORT/ICETOOL.....itz Urgent....
Reply with quote

Hi Kishore,

After looking at the sample you provided.... It seems the latest valuation Date comes in the last most recod for the name.....If this is correct as per your Input File...

Code:
//S030     EXEC PGM=ICETOOL                   
//TOOLMSG   DD SYSOUT=*                       
//DFSMSG    DD SYSOUT=*                       
//IN     DD DSN=RECORDS.INPUT,DISP=SHR
//OUT    DD DSN=RECORDS.OUT,     
//          DISP=(,KEEP,DELETE),             
//TOOLIN DD *                                 
  SELECT FROM(IN) TO(OUT) ON(1,3,CH) LASTDUP 
//


P.S. Here I assumed the number appearing before Name is unique to that name.

Now comes the part to increase the date field by one month...

Do you have date field located in a specific length only.
I mean...what is the starting & ending position for that...

Regards,

Priyesh.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Aug 29, 2005 8:54 pm    Post subject:
Reply with quote

Kishore,

You requirement, as stated, is confusing and doesn't make a whole lot of sense.

You said
Quote:
the output should have the latest valuation date
.
In your first post, you show the output as:

123kishore 20051030
111sachin 19991030

which does have the latest date for each key. But in your second post, you show the output as:

123kishore 20051010
111sachin 20000130

Subtracting 1 month from the dates would give:

123kishore 20050910
111sachin 19991230

which would be the earliest date for 123kishore and the latest date for 111sachin. So we don't know if you actually want the latest date or the earliest date.

In addition, adding 1 month to a yyyymmdd date will NOT always give a valid date. For example, if the original date is 20050131 and you add 1 month to it, you get 20050231 which is NOT a valid date.

You need to rethink and restate your requirement so it makes sense.
Back to top
View user's profile Send private message
ykishore

New User


Joined: 12 Aug 2005
Posts: 53
Location: USA

PostPosted: Thu Sep 01, 2005 6:33 pm    Post subject:
Reply with quote

HI Frank

this is extension to my requirement posted on sometime before....

i want the latest Valuation date and i suppose to one month(Month part of the field) to those records which are to be reported...


Eq:

123kishore 20051031
123kishore 20001201
111sachin 19980220
111sachin 19991230

output:
--------
123kishore 20051031
111sachin 19991230

but i want to increase one month for the above output records..

please advise me !!
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Sep 01, 2005 8:45 pm    Post subject:
Reply with quote

Quote:
but i want to increase one month for the above output records..



As I stated before:

Quote:
adding 1 month to a yyyymmdd date will NOT always give a valid date. For example, if the original date is 20050131 and you add 1 month to it, you get 20050231 which is NOT a valid date.


So you need to define what you mean by adding 1 month to the date. In the example output records you show, adding 1 to the mm field would give:

123kishore 20051131
111sachin 19991330

Those are both invalid dates. November only has 30 days. Changing 19991330 to 20000130 would happen to give a valid date, but that won't always be the case when you add 1 to mm and bump yyyy by 1 when mm=13.

So you really need to think about how to get valid dates and let us know what rules you want to use for that.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Urgent Mainframe Requirments (2-10 yr... Shankar779 Mainframe Jobs 0 Sun Nov 27, 2016 1:48 pm
No new posts How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts ICETOOL/SYNCSORT - SYSPRINT output nartcr DFSORT/ICETOOL 17 Wed Oct 05, 2016 10:46 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm


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