View previous topic :: View next topic
|
Author |
Message |
PPeplinski
New User
Joined: 06 Jan 2006 Posts: 8
|
|
|
|
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 |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
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 |
|
|
PPeplinski
New User
Joined: 06 Jan 2006 Posts: 8
|
|
|
|
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 |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
Back to top |
|
|
PPeplinski
New User
Joined: 06 Jan 2006 Posts: 8
|
|
|
|
Thank you. I had hoped the date conversion formats would make the solution less programmatic. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
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 |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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
d |
|
Back to top |
|
|
PPeplinski
New User
Joined: 06 Jan 2006 Posts: 8
|
|
|
|
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 |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
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 |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
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 |
|
Back to top |
|
|
PPeplinski
New User
Joined: 06 Jan 2006 Posts: 8
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
PPeplinski
New User
Joined: 06 Jan 2006 Posts: 8
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|