routine to convert date format 0CYYDDDF to format DD/MM/YY or DDMMYY 
Author Message
 routine to convert date format 0CYYDDDF to format DD/MM/YY or DDMMYY

I must insert to my exit IEFACTRT, a routine to convert date format 0CYYDDDF
from SMF30STD to format DD/MM/YY  or DDMMYY

If someone can give me the code of this routine, it will save me lot of
time...

Thanks to all,

Gilbert



Mon, 11 Feb 2002 03:00:00 GMT  
 routine to convert date format 0CYYDDDF to format DD/MM/YY or DDMMYY
Rather than writing your own routine I suggest you look into the macros:
CONVTOD (which converts any time and date format into TOD format) and
STCKCONV (which does the reverse conversion)

Together these two macros will do what you seem to want.

hth

regards Sven


Quote:
>I must insert to my exit IEFACTRT, a routine to convert date format
0CYYDDDF
>from SMF30STD to format DD/MM/YY  or DDMMYY

>If someone can give me the code of this routine, it will save me lot of
>time...

>Thanks to all,

>Gilbert



Mon, 11 Feb 2002 03:00:00 GMT  
 routine to convert date format 0CYYDDDF to format DD/MM/YY or DDMMYY
On Thu, 26 Aug 1999 08:43:14 +0300 "Gilbert Sudarskis"

:>I must insert to my exit IEFACTRT, a routine to convert date format 0CYYDDDF
:>from SMF30STD to format DD/MM/YY  or DDMMYY

:>If someone can give me the code of this routine, it will save me lot of
:>time...

Why not use the IBM services?

First do a CONVTOD to make it in clock format.

Then you can use STCKCONV to make it look like whatever you want.

--


http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel



Mon, 11 Feb 2002 03:00:00 GMT  
 routine to convert date format 0CYYDDDF to format DD/MM/YY or DDMMYY


Quote:
> I must insert to my exit IEFACTRT, a routine to convert date format
0CYYDDDF
> from SMF30STD to format DD/MM/YY  or DDMMYY

> If someone can give me the code of this routine, it will save me lot of
> time...

There must be thousands of these routines around, here is one of my wheels.
 It converts from packed 0CYYDDDF to unpacked DDMMYY (C ignored).  If you
want the program to be fully reentrant, DAYTABLE too should be copied to
working storage.  If the input days are out of range, you will end up with
with some odd date in month 13, but this will not happen with data from the
time SVC.

* extract 2-digit year
         UNPK  YY(1),JULIAN+1(1)      first digit
         OI    YY,X'F0'
         MVC   YY+1(1),JULIAN+1       second digit
         OI    YY+1,X'F0'
* adjust february for leap year
* (special hundred-year rule ignored)
         ZAP   FEBRUARY,=P'28'
         TM    JULIAN+1,B'00000001'   odd year?
         BO    NOTLEAP                yes, then not leap year
         TM    JULIAN+1,B'00010010'   divisable by 4?
         BM    NOTLEAP                no, then not leap year
         ZAP   FEBRUARY,=P'29'
* convert julian til gregorian format
NOTLEAP  ZAP   WDAYS,JULIAN+2(2)      julian days
         ZAP   WMONTH,=P'1'           start with month 1
         LA    R1,DAYTABLE            day table
LOOP     CP    WDAYS,0(2,R1)          this month?
         BNH   FINISH                 yes, finish
         SP    WDAYS,0(2,R1)          subtract days of this month
         LA    R1,2(R1)               next month in table
         AP    WMONTH,=P'1'           next month
         C     R1,=A(TABLEEND)        end of table?
         BL    LOOP                   no, try next
FINISH   UNPK  DD,WDAYS               unpack date
         OI    DD+1,X'F0'
         UNPK  MM,WMONTH              unpack month
         OI    MM+1,X'F0'

DAYTABLE DC    PL2'31,28,31,30,31,30,31,31,30,31,30,31'
TABLEEND EQU   *
FEBRUARY EQU   DAYTABLE+2,2,C'P'

WDOUBLE  DS    D
WDAYS    DS    PL3
WMONTH   DS    PL2

GREGDATE DS    0CL6
DD       DS    CL2
MM       DS    CL2
YY       DS    CL2

Gunnar.



Mon, 11 Feb 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. How to display date from unix format to dd/mm/yy format

2. how can I read a date (MM-DD-YY) via Topspeed ODBC

3. Any support for European (DD/MM/YY) dates?

4. from MM/DD/YYYY to YYYY-MM-DD

5. Tcl Date Routines don't handle ISO date formats

6. How to Get File Modify Time in MM/DD/YY Format?

7. Test yyyy,mm,dd dates with JULIAN program...

8. date routines yyyymmdd format needed

9. converting postscript to some format readable by Tk image formats

10. Convert singlelineedit entry into Date type format.

11. converting formatted string to date

12. Invalid dates - 215 using Btrieve/Clipper DATE format

 

 
Powered by phpBB® Forum Software