IBM Support

IV30116: STRPTIME() RETURNS IMPROPER MONTH IN JA_JP LOCALE. APPLIES TO AIX 6100-09

A fix is available

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The strptime subroutine returns incorrect month after
    setlocale()  if LANG=Ja_JP, JA_JP or ja_JP are used.
    
    This problem can be recreated with the following program:
    
    #include <time.h>
    #include <stdio.h>
    #include <sys/localedef.h>
    
    int main()
    {
      char* source_string="May132012.1";
      struct tm* result_tm;
      int i;
    
      setlocale(LC_ALL, (char*)getenv("LANG"));
    
      result_tm=(struct tm*)malloc(sizeof(struct tm));
    
      strptime(source_string,"%b %d %Y",result_tm);
      fprintf(stdout,"tm_mon=%d tm_mday=%d tm_year=%d ?n",
    
    result_tm->tm_mon,result_tm->tm_mday,result_tm->tm_year);
    
      exit(0);
    }
    # cc -o strptime strptime.c
    -----
    # LANG=Ja_JP
    # locale
    LANG=Ja_JP
    LC_COLLATE="Ja_JP"
    LC_CTYPE="Ja_JP"
    LC_MONETARY="Ja_JP"
    LC_NUMERIC="Ja_JP"
    LC_TIME="Ja_JP"
    LC_MESSAGES="Ja_JP"
    LC_ALL=
    # ./strptime
    tm_mon=2 tm_mday=13 tm_year=112 <== tm_mon=2 is
    "Mar"(incorrect)
    -----
    # LANG=JA_JP
    # locale
    LANG=JA_JP
    LC_COLLATE="JA_JP"
    LC_CTYPE="JA_JP"
    LC_MONETARY="JA_JP"
    LC_NUMERIC="JA_JP"
    LC_TIME="JA_JP"
    LC_MESSAGES="JA_JP"
    LC_ALL=
    # ./strptime
    tm_mon=2 tm_mday=13 tm_year=112 <== tm_mon=2 is
    "Mar"(incorrect)
    -----
    # LANG=ja_JP
    # locale
    LANG=ja_JP
    LC_COLLATE="ja_JP"
    LC_CTYPE="ja_JP"
    LC_MONETARY="ja_JP"
    LC_NUMERIC="ja_JP"
    LC_TIME="ja_JP"
    LC_MESSAGES="ja_JP"
    LC_ALL=
    # ./strptime
    tm_mon=2 tm_mday=13 tm_year=112 <== tm_mon=2 is
    "Mar"(incorrect)
    

Local fix

  • n/a
    

Problem summary

  • STRPTIME() RETURNS IMPROPER MONTH IN JA_JP LOCALE.
    

Problem conclusion

  • Change the sequence of conditional checks.
    

Temporary fix

Comments

  • 6100-08 - use AIX APAR IV29815
    6100-09 - use AIX APAR IV30116
    7100-02 - use AIX APAR IV29427
    

APAR Information

  • APAR number

    IV30116

  • Reported component name

    AIX 610 STD EDI

  • Reported component ID

    5765G6200

  • Reported release

    610

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Submitted date

    2012-10-12

  • Closed date

    2012-10-12

  • Last modified date

    2013-11-25

  • APAR is sysrouted FROM one or more of the following:

    IV25561

  • APAR is sysrouted TO one or more of the following:

    U863357

Fix information

  • Fixed component name

    AIX 610 STD EDI

  • Fixed component ID

    5765G6200

Applicable component levels

  • R610 PSY U863357

       UP13/11/25 I 1000

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SG11Q","label":"AIX 6.1 HIPERS, APARs and Fixes"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"610","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}},{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SSMV87","label":"AIX 6.1 Enterprise Edition"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"610","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}},{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSMVAX","label":"AIX Express Edition"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"610","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}},{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSAUMY","label":"IBM AIX Enterprise Edition"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"610","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}},{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SG11Q","label":"AIX 6.1 HIPERS, APARs and Fixes"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"610","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}},{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SG11R","label":"APARs - AIX 7.1 environment"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"610","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Document Information

Modified date:
17 December 2021