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
 

 

date Difference using Syncsort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: date Difference using Syncsort
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Mon Sep 26, 2011 4:14 pm    Post subject: Reply to: date Difference using Syncsort
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    Post subject:
Reply with quote

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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Mon Sep 26, 2011 4:25 pm    Post subject: Reply to: date Difference using Syncsort
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Sep 26, 2011 4:29 pm    Post subject: Reply to: date Difference using Syncsort
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Sep 26, 2011 4:37 pm    Post subject: Reply to: date Difference using Syncsort
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Mon Sep 26, 2011 4:39 pm    Post subject: Re: Reply to: date Difference using Syncsort
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Sep 26, 2011 4:41 pm    Post subject: Reply to: date Difference using Syncsort
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Sep 26, 2011 4:56 pm    Post subject: Reply to: date Difference using Syncsort
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Mon Sep 26, 2011 5:02 pm    Post subject: Reply to: date Difference using Syncsort
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 3 Fri Dec 02, 2016 9:47 am
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts Sticky: difference between ... DUMMY ... and ... enrico-sorichetti JCL & VSAM 0 Mon Oct 17, 2016 4:31 pm


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