date Difference using Syncsort

Author Message

Active User

Joined: 29 Jun 2009
Posts: 197
Location: Mumbai

 Posted: Mon Sep 26, 2011 4:10 pm 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
Bill Woodger

Moderator Emeritus

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

 Posted: Mon Sep 26, 2011 4:14 pm 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?

Active User

Joined: 29 Jun 2009
Posts: 197
Location: Mumbai

 Posted: Mon Sep 26, 2011 4:21 pm Yes, I want the difference in number of days.
Bill Woodger

Moderator Emeritus

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

 Posted: Mon Sep 26, 2011 4:25 pm 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?
enrico-sorichetti

Superior Member

Joined: 14 Mar 2007
Posts: 10833
Location: italy

Posted: Mon Sep 26, 2011 4:29 pm

 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?

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

Active User

Joined: 29 Jun 2009
Posts: 197
Location: Mumbai

 Posted: Mon Sep 26, 2011 4:35 pm 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
enrico-sorichetti

Superior Member

Joined: 14 Mar 2007
Posts: 10833
Location: italy

Posted: Mon Sep 26, 2011 4:37 pm

&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 !
Bill Woodger

Moderator Emeritus

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

Posted: Mon Sep 26, 2011 4:39 pm

enrico-sorichetti wrote:
 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?

 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.

"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.
enrico-sorichetti

Superior Member

Joined: 14 Mar 2007
Posts: 10833
Location: italy

Active User

Joined: 29 Jun 2009
Posts: 197
Location: Mumbai

 Posted: Mon Sep 26, 2011 4:47 pm 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
enrico-sorichetti

Superior Member

Joined: 14 Mar 2007
Posts: 10833
Location: italy

 Posted: Mon Sep 26, 2011 4:56 pm 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
Bill Woodger

Moderator Emeritus

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

 Posted: Mon Sep 26, 2011 5:02 pm 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).

Active User

Joined: 29 Jun 2009
Posts: 197
Location: Mumbai

 Posted: Mon Sep 26, 2011 5:37 pm 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.
 View Bookmarks All times are GMT + 6 Hours

 Topic Forum Replies Similar Topics SMF Record Date conversion failing CLIST & REXX 1 Removal of date value records DFSORT/ICETOOL 12 Count Records with a crietaria in a f... DFSORT/ICETOOL 5 DFSORT/SYNCSORT/ICETOOL JCL & VSAM 8 What is the difference between Taskty... Compuware & Other Tools 2
Search our Forums:

 IBMMainframes.com is not an official and/or affiliated with IBM® in anyway Board Rules | FAQ | Downloads | Wiki | SiteMap | Contact Us