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
 

 

Simple date conversion using Syncsort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
PPeplinski

New User


Joined: 06 Jan 2006
Posts: 8

PostPosted: Fri Jul 13, 2012 11:51 pm    Post subject: Simple date conversion using Syncsort
Reply with quote

I do very little in Syncsort. I have read the manual, specifically the 1.4 OUTREC parameter. Still. I am not sure what/how to code it. The actual project has nothing to do with Syncsort and I could use other utilities or programs to do the conversion.

Simply stated I am comparing two files where date is one of my keys. One file has the date in column 65 in MM/DD/YYYY format and the other has the date in column 35 in YYYYDDD format. Both files have LRECL 133.

I can convert either but the YYYYDDD works best for sequencing the file.

Paul
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Sat Jul 14, 2012 12:17 am    Post subject:
Reply with quote

Paul,

Please state your problem

What are you trying to achieve?
What is your input data? Please share us some same simulated data
what is the output you are expecting?

Also please make use of code tag while pasting input and expected output
Back to top
View user's profile Send private message
PPeplinski

New User


Joined: 06 Jan 2006
Posts: 8

PostPosted: Sat Jul 14, 2012 12:26 am    Post subject: Reply to: Simple date conversion using Syncsort
Reply with quote

One of my files has date in position 65 in MM/DD/YYYY format, for example 09/30/2011. I want to use Syncsort to alter that in place to 2011273 using the date conversion formats. It seems that I might first have to strip out the separators.

Paul
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Sat Jul 14, 2012 12:56 am    Post subject:
Reply with quote

Check here for sample idea
Back to top
View user's profile Send private message
PPeplinski

New User


Joined: 06 Jan 2006
Posts: 8

PostPosted: Sat Jul 14, 2012 1:29 am    Post subject:
Reply with quote

Thank you. I had hoped the date conversion formats would make the solution less programmatic.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Sat Jul 14, 2012 3:51 am    Post subject: Reply to: Simple date conversion using Syncsort
Reply with quote

I think the topic posted is a little old. Have a look in your manual. You may find there are lots of date functions, some of which you can use. It'll still be "programatic" to some extent, but that kind of comes with the territory.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Jul 14, 2012 9:06 am    Post subject:
Reply with quote

Hello,

If you have the 1.4 documentation, you might search it for "date conversion" or "date formats" or similar. I won't be near the system that has my 1.4 doc until Monday and so far have not been able to get a vpn connection authorized. . .
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Sat Jul 14, 2012 12:06 pm    Post subject:
Reply with quote

PPeplinski,

AFAIK Syncsort 1.4 supports a few new date manipulation functions. I am away from work now, will update here if I find something useful.

Hi Dick,

Are you @ Syncsort 1.4 level? I am still @ 1.3.2 icon_sad.gif
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Jul 14, 2012 11:07 pm    Post subject: Reply to: Simple date conversion using Syncsort
Reply with quote

Hi Arun,

One Syncsort client just went from 1.1 (yup, that is NOT a typo - years behind) directly to 1.4. They also upgraded 1.1 from z/OS 7 to 9 to 11 (against the advice of Syncsort - i had hoped the old release would not run and would have to be upgraded<g>).

Seems like some department "critically" needed some of the new 1.4 features. . . I just use what is on the machine and try to make the case to keep the software reasonably current icon_cool.gif

d
Back to top
View user's profile Send private message
PPeplinski

New User


Joined: 06 Jan 2006
Posts: 8

PostPosted: Mon Jul 16, 2012 9:25 pm    Post subject: Reply to: Simple date conversion using Syncsort
Reply with quote

Yes, I saw the datye conversion "functions" although the syntax is pretty cryptic. I think the separators in the input field make it less straight forward, even though there is support for separators in the output field.

Paul
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Mon Jul 16, 2012 11:08 pm    Post subject:
Reply with quote

PPeplinski,

I guess you have already figured out the YD and YDNS subparameters. But I thought the syntax is pretty straightforward. For your particular requirement, I believe the Y2T or Y2W input date format along with YD or YDNS subparameter would do the trick.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Mon Jul 16, 2012 11:20 pm    Post subject:
Reply with quote

If input date is of the form yymmdd and starting at pos-1,
Code:
  OUTREC FIELDS=(1,6,Y2T,YD=(4D/))
to obtain the julian output in YYYY/DDD format.

If input date is of the form mmddyy and starting at pos-1,
Code:
  OUTREC FIELDS=(1,6,Y2W,YD=(4D/))
to obtain the julian output in YYYY/DDD format.

Instead of 4, Y could be used to obtain 2 digit years in output, Y 4 and D can be specified only once and in any order that you need. I am running an older version and can't test this out now icon_sad.gif
Back to top
View user's profile Send private message
PPeplinski

New User


Joined: 06 Jan 2006
Posts: 8

PostPosted: Tue Jul 17, 2012 12:44 am    Post subject:
Reply with quote

That was the type of solution that I was looking for, as opposed to the one that uses addition based on the year (to address leap year), the month, and then finally the day.

Unfortunately, by date is in position 65 with the format MM/DD/YYYY, which does not seem to be represented in a Syncsort format.

Paul
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue Jul 17, 2012 2:04 am    Post subject: Reply to: Simple date conversion using Syncsort
Reply with quote

Fortunately it is the work of only a moment to rearrange it, "outside" the existing data on the record (front for variable records, end for fixed) and then us that date...
Back to top
View user's profile Send private message
PPeplinski

New User


Joined: 06 Jan 2006
Posts: 8

PostPosted: Tue Jul 17, 2012 2:21 am    Post subject:
Reply with quote

I trust that is true, and probably second nature to someone well versed in SORT. For me it was just a means to an end, and I have encountered other unanticipated data massaging requirements so it makes more sense for to do it all in an EZT or REXX.

Thank you

Paul
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Jul 17, 2012 8:32 am    Post subject:
Reply with quote

Hello,

Depending on the volume of data, you may find REXX performance completely unacceptable. . .

Yup, if there area business rules to be implemented, a programming language is better suited. JustMHO.
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 1 Fri Dec 02, 2016 9:47 am
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
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
No new posts Conversion of a VB file to FB. isssal DFSORT/ICETOOL 1 Mon Oct 31, 2016 10:23 pm


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