Announcement

Collapse
No announcement yet.

Running CHGDTA command in CL programming?

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

  • Running CHGDTA command in CL programming?

    Hi folks, this is a task I've received from my online professor, who is conveniently away for a month after assigning this lol....(tl;dr version at bottom)

    I'm trying to create a CL program that will run a DFU program that I've already created.


    Breakdown of what's what:

    structure of the library

    Code:
      CUSTINFOLB  
    
    CIF                *PGM       DFU
    
    CIFCL99          *PGM       CLLE
    
    CIF                 *FILE       DFU
    
    CIFFILE            *FILE       PFDTA
    
    CIFFILE1           *FILE       LF
    
    QCLSRC            *FILE       CONTAINS CLLE CODE CIFCL99
    
    QDDSSRC         *FILE       CONTAINS DDS CODE FOR CIFFILE, CIFFILE1

    This really is my first time programming in CL, so I don't even know if the syntax is right.

    what I have so far:

    Code:
    PGM
                       CHGDTA DFUPGM(CIF) FILE(CUSTINFOLB/CIFFILE1)
    
    ENDPGM
    it compiles successfully, and when I call the CL program
    CALL CUSTINFOLB/CIFCL99 it doesn't do anything, I see the xSystem (in white) appear and then thats it, nothing else happens.

    What should appear is the DFU program allowing me to insert or change data.

    :::tl;dr::::

    I'm trying to create a CL Program and this is the breakdown of the requirements I've gathered:

    CL program calls DFU program
    a menu with options will pop up

    - Initiate CIF Program

    - Exit
    When a user selects an option a message will appear stating an action has been taken, example: "CIF Data Entry Program is now executing"

    I really appreciate any help I can get. I just don't know what I'm doing wrong. I've asked help on another website as well, but im desperate trying to get help anywhere i can right now.
    __________________________________________________ _________________________


    In case that's a little confusing, here's the background on my assignment, what's coloured in red is already completed.

    Code:
    ?    Create 4 DDS Specifications for each of the 4 file groups based on the information specified at the end of the assignment. (based on the names listed at the end of the assignment)
    ?    Create 4 DFU programs for each of the 4 files you set up with DDS specifications.
    ?    Create 4 CL programs to run the DFU programs you have created. (based on the names listed at the end of the assignment)
    o    Include some comments as well as a message that will appear on the screen once the menu option has been chosen. 
    o    For example, if you chose Option # 1 to Enter CIF data, a message should initially appear such as - 
                         'CIF DATA ENTRY PROGRAM IS NOW EXECUTING' 
    ?    Create 3 Menus for each of the 3 departments(Order Entry/Inventory /Purchasing) (based on the names listed at the end of the assignment) with appropriate titles on each menu.
    ?    Create a main menu called MAINMENU to access the 3 department menus.
    ?    Create a Query/400 report based on the CIF file and add it to the main menu as an option. 
    ?    Ensure that you have followed the 3 requirements as follows:
    o    Create the Query as a report by choosing the  'Print' option. 
    o    Format the CIF # to eliminate the ?,? from the number on the report.
    o    Place a Page heading on the report.
    ?    The Main menu should include the following menu options:
    o    Go to the 3 various ?department? menus
    o    Run the CIF Query program
    o    Access the Spool file
    o    Sign off 
    ?    Set up the CLP programs on the menus you have created.

  • #2
    Re: Running CHGDTA command in CL programming?

    Did you create the CIF DFU program? Is there data in the CifFile? This should not matter as the DFU should start in ADD mode. Look at the job log. DSPJOBLOG for what might be the issue.


    On a side note, i want to kick the professor in the nuts for teaching you what DFU is. This is so 90's. So is Query/400.
    Hunting down the future ms. Ex DeadManWalks. *certain restrictions apply

    Comment


    • #3
      Re: Running CHGDTA command in CL programming?

      Originally posted by DeadManWalks View Post
      Did you create the CIF DFU program? Is there data in the CifFile? This should not matter as the DFU should start in ADD mode. Look at the job log. DSPJOBLOG for what might be the issue.


      On a side note, i want to kick the professor in the nuts for teaching you what DFU is. This is so 90's. So is Query/400.

      I did create the CIF DFU program and the program has records entered. CIFFILE and CIFFILE1 do have data, both of which compiled successfully, and the DFU program works perfectly fine.


      I had no idea about the DSPJOBLOG so thank you for that i'll check it out.

      and i agree lol the curriculum for my course is really outdated, and the funny thing is I didn't even know half the stuff im learning is outdated, and certainly didn't know DFU was part of it lol.

      Comment


      • #4
        Re: Running CHGDTA command in CL programming?

        Okay i checked it out and it says

        CALL CUSTINFOLB/CIFCL99
        File CIF created in library BL233A34
        DFU could not find program CIF in library *LIBL

        which is weird because I have it written as


        Code:
         CHGDTA DFUPGM(CIF) FILE(CUSTINFOLB/CIFFILE1)
        and even changed FILE(CUSTINFOLB/CIF)

        CIF is the name of the *PGM and the name of the *FILE with the attribute DFU, so I have no idea why it's not working :/

        Comment


        • #5
          Re: Running CHGDTA command in CL programming?

          lol if the moderator by chance reads this first, please delete my other two msgs. thanks!


          the DSPJOBLOG command was an excellent idea, i eventually figured out what it meant when it said DFU program CIF could not be found in *LIBL, i realized i wasn't declaring the library in which the DFU program existed.

          thank you so much DeadManWalks, it launches in ADD mode. Now I have to create the other CL program which will now be easy thanks to you, once that's done I need to figure out how to Create menus to include these programs but, whichever program I choose, a message has to appear saying something is happening like "now executing CIF program", I'm guessing that happens in the CL program itself. I would use something like SNDUSRMSG i think? the only problem is, how do I set the conditions so that when the program is selected, it knows when to display it's message :/

          Comment

          Working...
          X