ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

*DATE returns wrong value when called by a .NET page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • *DATE returns wrong value when called by a .NET page

    This is a weird situation we have having. We are using C# (dot net) to launch a program that prints some stuff to the spool.

    The problem is that the report uses *DATE to print the current date in the report, and the date always show 21/06/2008! (june 21 2008)

    We can only guess that the interop dll uses a different job date. Has anyone had this problem?

    The program that is being called just uses EXCEPT HEADER and the headers just prints *date.

    PHP Code:
    string AS400Name "192.9.200.1";
            
    string AS400User "webusr";
            
    string AS400Password "webusr"
            
    string AS400Pgm "PIEDRA"
            
    string AS400Lib "PRODUCTEST";

            
    cwbx.AS400System AS400 = new cwbx.AS400SystemClass(); 
            
    cwbx.Program program = new cwbx.Program(); 

            
    AS400.Define(AS400Name); 
            
    program.system AS400;
            
    program.system.UserID AS400User
            
    program.system.Password AS400Password;      
            
    program.LibraryName AS400Lib
            
    program.ProgramName AS400Pgm;

            
    AS400.Signon();
            
    AS400.Connect(cwbcoServiceEnum.cwbcoServiceRemoteCmd);
            if (
    AS400.IsConnected(cwbcoServiceEnum.cwbcoServiceAll) != 0)
            {
                try
                {
                    
    program.Call(); 
                    
    Console.ReadLine();
                }
                catch (
    Exception exc)
                {
                    foreach (
    Error error in AS400.Errors)
                    {
                        
    Console.WriteLine(error.ToString());
                    }
                }
            } 

  • #2
    Re: *DATE returns wrong value when called by a .NET page

    *DATE is the job date not the system date. if the .net program stays connected (or the iseries system job being used is still running) it will reflect the date the job entered the system. use a variable and %DATE() and print the variable on the header instead of using *DATE.
    I'm not anti-social, I just don't like people -Tommy Holden

    Comment


    • #3
      Re: *DATE returns wrong value when called by a .NET page

      by default, when the user logs in, each user opens a job and gets the current date. The profile used for web connections (webusr) must be different somehow. I will try your solution

      what we don't understand is that we are trying it with a different account, one that logs in and should be setting the job date. But somehow, even using a profile that should have an updated job date, it somehow manages to use another date.
      Last edited by fjleon; July 22, 2008, 04:01 PM. Reason: additional info

      Comment


      • #4
        Re: *DATE returns wrong value when called by a .NET page

        but the connection job is still the same job. especially when using ODBC connections, etc. there are server jobs that handle the communications...
        I'm not anti-social, I just don't like people -Tommy Holden

        Comment


        • #5
          Re: *DATE returns wrong value when called by a .NET page

          all right, i understand, i will ask a similar question but on a different topic to keep this one nice and tidy. thanks

          Comment

          Working...
          X