IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

date Difference using Syncsort


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Ketan Varhade

Active User


Joined: 29 Jun 2009
Posts: 197
Location: Mumbai

PostPosted: Mon Sep 26, 2011 4:10 pm
Reply with quote

Hi,
Is there any function avaiable in Syncsort to calculate the date difference
from two file?

for eg file 1
20110926

file 2
20110925


output should be :
1
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Sep 26, 2011 4:14 pm
Reply with quote

You have two single-record datasets, each with a date on, and you'd like to calculate the difference with the answer as a number of days?

Would it help you to concatenate the datasets, so that the first record is from dataset 1 and the second from dataset 2?
Back to top
View user's profile Send private message
Ketan Varhade

Active User


Joined: 29 Jun 2009
Posts: 197
Location: Mumbai

PostPosted: Mon Sep 26, 2011 4:21 pm
Reply with quote

Yes, I want the difference in number of days.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Sep 26, 2011 4:25 pm
Reply with quote

Blood-from-a-stone time :-)

I really understood the bit about you wanting days. What I was hoping to know were the answers to the other questions.

You have dates on two seperate datasets - how many records on each dataset?

Would it help you, ie would you then be able to proceed with the code, if both the dates were on the same dataset as seperate records, or have you no clue at all about how to do this?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Sep 26, 2011 4:29 pm
Reply with quote

Your first question
Quote:
You have two single-record datasets, each with a date on, and you'd like to calculate the difference with the answer as a number of days?

His reply
Quote:
Yes, I want the difference in number of days.
Back to top
View user's profile Send private message
Ketan Varhade

Active User


Joined: 29 Jun 2009
Posts: 197
Location: Mumbai

PostPosted: Mon Sep 26, 2011 4:35 pm
Reply with quote

there are two diffrent PS and number of record in each PS is same.

for eg;
for eg file 1
date ID
20110926 ABC
20110901 XYZ


file 2 ID
20110925 ABC
20110830 XYZ


output should be :
1
2


there can be many record and input is also have a key field on which the match will be done. in this case ID is the key
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Sep 26, 2011 4:37 pm
Reply with quote

&holy &shit... why did You reply yes to the question
Quote:
You have two single-record datasets, each with a date on, and you'd like to calculate the difference with the answer as a number of days?


after more than 100 posts You should know how to post better !
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Sep 26, 2011 4:39 pm
Reply with quote

enrico-sorichetti wrote:
Your first question
Quote:
You have two single-record datasets, each with a date on, and you'd like to calculate the difference with the answer as a number of days?

His reply
Quote:
Yes, I want the difference in number of days.


Mmmm... at least I didn't get the pointers about how to ask a question properly...

My question can be answered "Yes", or it can be answered "No, I want this.." followed by a lucid explanation.

From "Yes" and a subset of my question associated with that, I have no further clue about the answer I actually want, which is whether there is one or more records on either of the datasets.

"Do you want salad and potatoes with your chicken?"

"Yes please".
"No, real coders don't do salad, but I do like potato".
"I'm sorry, I must have misspoken, I'd like fish, with some fresh pasta if that is possible".
"Yes, I want chicken".

The first three answers are a useful, the fourth gets nowhere.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Sep 26, 2011 4:41 pm
Reply with quote

follow on ...
and please avoid to make people willing to help You look dumb
Back to top
View user's profile Send private message
Ketan Varhade

Active User


Joined: 29 Jun 2009
Posts: 197
Location: Mumbai

PostPosted: Mon Sep 26, 2011 4:47 pm
Reply with quote

I thought that my question was clear enough. May be there is some problem in expressing. I will search the forum and see if i get any thing that can help me.
Thank you
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Sep 26, 2011 4:56 pm
Reply with quote

the initial posts hinted two files with a single record and no key

as an hint
use the JOINKEYS to couple the records with the same key,
after that a date difference from two columns of the same record would me mopre than enough
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Sep 26, 2011 5:02 pm
Reply with quote

Your question is clear enough if all the information that you know is known.

Let me try this:

I have a task whereby I have to find the difference in the dates between records on two different PS datasets. I need the difference as a number of days.

The records each have a key. The date is in the form CCYYMMDD.

I can do all the coding to match the records in the datasets, but I don't know how to do the date subtraction with the dates in two different files.

Does anyone have any pointers, please? I can/cannot use xTOOL. I can/cannot use more than one STEP. I do/do not have a SyncSort manual available. (delete as applicable).
Back to top
View user's profile Send private message
Ketan Varhade

Active User


Joined: 29 Jun 2009
Posts: 197
Location: Mumbai

PostPosted: Mon Sep 26, 2011 5:37 pm
Reply with quote

I know how to use join keys. I have written that much of code to match the file on the key feild position, while writing the outrec I am not able to calcluate the difference. I did some search on DATE in syncsort but I didnt get any info that can help me.
current code(sysin) i am able to write till reformat fields.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
Search our Forums:

Back to Top