MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Convert the special date using SORT

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
vij
Beginner


Joined: 13 Dec 2002
Posts: 6
Topics: 2

PostPosted: Mon May 19, 2008 11:41 am    Post subject: Convert the special date using SORT Reply with quote

We use a special date field in our application (stores in Dataset/file), sometime it need to convert into Gregorian date YYYYMMDD in the output file or report. Normally we invoke a special internal program to convert it.

Input special date is a 3 bytes packed number from X'99999D', X'99998D' X'99997D'
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Mon May 19, 2008 12:42 pm    Post subject: Reply with quote

vij,

Sort can handle fixed pos fields. However you can use symbols to dynamically generate the position of the string and then convert it. But the name of the field should remain the same in all layouts.

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon May 19, 2008 2:31 pm    Post subject: Reply with quote

Quote:
We use a special date field in our application


Vij,

Where do you use them? In fields to be sorted? In fields to be included? In fields to be displayed?

Are your input dates X'yyddds' dates or X'dddyys' dates?

You show dates from X'99999D' to X'99999C' but you only say what the first few represent. What would X'00000C' and X'99999C' represent? Surely every date can't be considered a "special date" ... what about X'99001C' ... wouldn't that be a real yyddd date?

You need to be more specific about what the special dates actually are, what they represent, and what you're trying to do with them.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vij
Beginner


Joined: 13 Dec 2002
Posts: 6
Topics: 2

PostPosted: Tue May 20, 2008 3:16 am    Post subject: Reply with quote

Hi Kolusu/Frank Yaeger

Thanks for your reply

The special date is invented as a Y2K solution. It is NOT a Julian format (YYDDDS or DDDYYS). It is just +ive or -ive number.

X'99999C' represents 1900/01/01
X'99998C' represents 1900/01/02
X'99997C' represents 1900/01/03
Back to top
View user's profile Send private message
vij
Beginner


Joined: 13 Dec 2002
Posts: 6
Topics: 2

PostPosted: Tue May 20, 2008 3:29 am    Post subject: Reply with quote

sorry, typing mistake

X'99999C' represents 1900/01/01
X'99998C' represents 1900/01/02
X'99997C' represents 1900/01/03

should be
X'99999D' represents 1900/01/01
X'99998D' represents 1900/01/02
X'99997D' represents 1900/01/03
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue May 20, 2008 10:06 am    Post subject: Reply with quote

Given that your shop "invented" this strange Y2K solution which I've never heard of anyone else using, why would you expect DFSORT to have a built-in function for converting it? DFSORT has extensive Y2x formats for Y2K functions for that kind of thing.

If you want to make your E15 or E35 generic for converting this date in different locations, why not have the E15 or E35 read a control statement that gives the location and use that in the E15 or E35.

Note that D1 is only used for SORT or MERGE fields, not for converting fields.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vij
Beginner


Joined: 13 Dec 2002
Posts: 6
Topics: 2

PostPosted: Tue May 20, 2008 11:05 am    Post subject: Reply with quote

Good idea Frank Yaeger.

I can use E15/E35 exit routine as your suggestion.

I will code "SPLDATE" in my SYSIN card, like
OUTREC FIELDS=(1,3,SPLDATE
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue May 20, 2008 12:54 pm    Post subject: Reply with quote

I don't think you understood my suggestion. Or maybe I don't understand what you're trying to do.

You said you wanted a generic E15 that could convert the date in a given position. My suggestion was to pass the position to the E15 in a control statement, not in SYSIN. For example, if the date starts in position 25 for one run, you could pass it using:

//DATEPOS DD *
00025
/*

If the date starts in position 31 for another run, you could pass it using:

//DATEPOS DD *
00031
/*

The first time the E15 is called, it OPENs DATEPOS, reads the card, saves the position it finds there, and CLOSEs DATEPOS. Then it can use the saved position on that (first) call and every other call to the E15.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vij
Beginner


Joined: 13 Dec 2002
Posts: 6
Topics: 2

PostPosted: Tue May 20, 2008 3:11 pm    Post subject: Reply with quote

Thanks Frank Yaeger,

I am clear now. Thanks lot for your help.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group