MTHNAME C++ Implementation

Note:

Source:

// MTHNAME: Sample User Written Routine in C++
// Warning: Use on MVS OE requires extension to be renamed as .C
extern "C" int mthname(double* mth, char* month)
{
const char *nmonth[13] = {"** Error **",
                           "January   ",
                           "February  ",
                           "March     ",
                           "April     ",
                           "May       ",
                           "June      ",
                           "July      ",
                           "August    ",
                           "September ",
                           "October   ",
                           "November  ",
                           "December  ",};
int imth, loop;
imth = (int)*mth;
imth = (imth < 1 || imth > 12 ? 0:imth);
for (loop=0;loop < 12;++loop)
     month[loop] = nmonth[imth][loop];
return 0;
}

iWay Software