Advertisement

10.15.2008 at 12:03PM PDT, ID: 23817921
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.0

What is the Library that the WRKSPLF command resides in?

Asked by pprater1 in Programming for iSeries / AS400, AS / 400, .NET Framework 2.x

Tags:

I am using the i Series Access for Windows cwbx.dll module to make remote calls to an AS400 machine for the first time.  I have posted the code below as to the method I am using.  The jist of the code is there is 2 buttons 1) Connect and 2) Send command - some text boxes are filled in (IP, UserID, Password, Library, Program.  Right now I am testing just the WRKSPLF call which is why the parameter building is static.  The library I am entering in the txtLibrary textbox is QSYS and the program in txtProgram is WRKSPLF.  When I run this code it gives me the message

MCH3401 - Cannot resolve to object WRKSPLF. Type and Subtype X'0201' Authority X'0000'.

I assume that I am not using the right Library.  Keep in mind that I am a .NET developer and am ignorant to most AS400 terminology and technique.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
Private Sub btnConnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConnect.Click
        CreateNew(txtIP.Text, txtUserID.Text, txtPassword.Text, _
                  txtLibrary.Text, txtProgram.Text)
    End Sub
 
 
 Private Sub btnSendCommand_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSendCommand.Click
        Dim stringConverter As cwbx.StringConverter = New cwbx.StringConverterClass()
        'Dim parameters As cwbx.ProgramParameters = New cwbx.ProgramParametersClass()
 
        'parameters.Append("Parameter1Name", cwbx.cwbrcParameterTypeEnum.cwbrcInout, 12)
        'stringConverter.Length = 12
        'parameters("Parameter1Name").Value = stringConverter.ToBytes("SomeString".PadRight(12, " "c))
 
 
        Dim prmParameterList As New cwbx.ProgramParameters
        Dim prmParameter As cwbx.ProgramParameter
 
        Try
            prmParameter = prmParameterList.Append("PRINTPARAM", cwbx.cwbrcParameterTypeEnum.cwbrcInout)
            stringConverter.Length = 6
            prmParameter.Value = stringConverter.ToBytes("OUTPUT (*PRINT)".PadRight(15, " "c))
 
            SendCommand(prmParameterList)
        Catch ex As Exception
            Output("Error sending command" & vbCrLf & ex.Message)
        End Try
    End Sub
 
Public Sub CreateNew(ByVal strAS400 As String, ByVal strUserID As String, _
                         ByVal strPassword As String, ByVal strLibrary As String, _
                         ByVal strProgram As String)
        If Not mblnConfigured Then
            as400 = New cwbx.AS400SystemClass()
            prgAS400Program = New cwbx.Program()
 
            Try
                as400.Define(strAS400)
 
                Try
                    With prgAS400Program
                        .system = as400
                        .system.UserID = strUserID
                        .system.Password = strPassword
                        '  .libraryName = strLibrary
                        .ProgramName = strProgram
                    End With
                Catch e As Exception
                    as400 = Nothing
                    prgAS400Program = Nothing
                End Try
 
                Try
                    as400.Connect(cwbx.cwbcoServiceEnum.cwbcoServiceRemoteCmd)
                                    Catch ex As Exception
                End Try
            Catch ex As Exception
                as400 = Nothing
                prgAS400Program = Nothing
            End Try
 
        End If
    End Sub
 
  Public Sub SendCommand(ByRef prmParameterList As cwbx.ProgramParameters)
        Try
            If as400.IsConnected(cwbx.cwbcoServiceEnum.cwbcoServiceRemoteCmd) = 0 Then
                '  Lost connection with the AS400. Disconnect, then reconnect. 
                as400.Disconnect(cwbx.cwbcoServiceEnum.cwbcoServiceAll)
                as400.Connect(cwbx.cwbcoServiceEnum.cwbcoServiceRemoteCmd)
            End If
 
            prgAS400Program.Call(prmParameterList)
        Catch e As Exception
 
           ' Capture to log the errors
            If as400.Errors.Count > 0 Then
                Dim intAS400IX As Int16 = 0
 
                ' Log something here. 
                For Each [error] As cwbx.Error In as400.Errors
                    intAS400IX += 1
                Next
            End If
 
            If prgAS400Program.Errors.Count > 0 Then
                Dim intPRGIX As Int16 = 0
 
                ' Log something here. 
                For Each [error] As cwbx.Error In prgAS400Program.Errors
                    intPRGIX += 1
                Next
            End If
 
        End Try
 
    End Sub
[+][-]10.15.2008 at 12:05PM PDT, ID: 22724479

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.15.2008 at 12:56PM PDT, ID: 22725098

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.15.2008 at 01:08PM PDT, ID: 22725249

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.15.2008 at 02:01PM PDT, ID: 22725844

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Programming for iSeries / AS400, AS / 400, .NET Framework 2.x
Tags: .NET AS400
Sign Up Now!
Solution Provided By: Gary_The_IT_Pro
Participating Experts: 3
Solution Grade: A
 
 
[+][-]10.15.2008 at 04:11PM PDT, ID: 22726836

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.15.2008 at 04:53PM PDT, ID: 22727017

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.15.2008 at 06:47PM PDT, ID: 22727508

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.15.2008 at 07:03PM PDT, ID: 22727613

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 - Hierarchy / EE_QW_2_20070628