ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Ocl // load #gsort

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

  • Ocl // load #gsort

    I'm in need of some insight.
    I have to maintain a large amount of OCL code until we finish modernizing to CLLE and I'm re-writing some of the code on a nightly procedure (MANY procedures).
    There is a block of code that does a GSORT:

    ************************************************** ********************
    * SORT INTO WEEKLY BUCKET ORDER *
    ************************************************** ********************
    // IF DATAF1-WO17B?WS? DELETE WO17B?WS?,F1
    *
    // LOAD #GSORT
    // FILE NAME-INPUT,LABEL-WO17A?WS?,DBLOCK-10
    // FILE NAME-OUTPUT,LABEL-WO17B?WS?,RECORDS-500,EXTEND-250
    // RUN
    HSORTR 24A 3X 256
    FNC 182 187 SORT DATE NUMBER = 6
    FNC 188 193 SORT DATE = 6
    FNC 167 167 ORDER COMPLETE CODE 1
    FNC 129 131 ORDER CODE = 3
    FNC 1 6 SALES ORDER NUMBER = 6
    FNC 7 8 LINE NUMBER = 2
    FDC 1 256
    /*

    which has that /* ending in it. I see /* referenced in the S/36 manual that indicates the end of data entered from the keyboard or the end of inline source data. Must be the last line of data being entered from the keyboard. I recognize that as a beginning of a comment block and have removed it in several instances. I figured it was somebody just copying/pasting code and had forgotten to remove the comment start. Anyway, is it needed for the sort to happen? Will the removal of it cause my code to blow up? All the code I've changed with it in it has not been placed in production and any testing I've done, it seems to run okay, but I haven't been watching for it in particular. Does anyone recall if that is necessary? Do I need to go back and put it back??

    Thanks.

    Rob
    Programmer/Systems Analyst

  • #2
    It been many decades since I used OCL, but IIRC
    Comments start with * on each line. The /* is a CL convention, not OCL.
    The /* is "end of data file" and is needed, although if its the last line it might be optional. I would test it.

    Comment


    • #3
      The /* pair means end of data, and you can use it to signal the end of the sort specs for #GSORT. However, I always used // END instead.

      Don't take it out. If you do, #GSORT will continue reading the OCL, looking for the end of the sort specs.

      Comment


      • #4
        Thanks Ted. I already went back and added it even before any responses. Not all of it, but most of it. Going to look at using // END in some instances just to see the difference. RDi makes quick work of the fix, but me remembering all the PGM's I changed it in will be something else. Moving to CLLE as quickly as I can, but there is a lot of OCL in our system and it can't get replaced fast enough.

        Rob
        Programmer/Systems Analyst

        Comment


        • #5
          Just as an addendum, I've been using // END to make it more clear. I don't care for the shortcut /*. CLLE cannot get onto my system fast enough, I wish there was a way to clone me to get this done faster. Staring at OCL (and converting) all day gives me a headache.
          Programmer/Systems Analyst

          Comment


          • #6
            Is there no way to write a one-off tool to take care of some of the conversion, Robert? When I have a repetitive task, that's what I do.

            This is the last issue of Four Hundred Guru for 2014, and in the last issue of a year I try to write about something unusual, something different from the routine stuff we usually run in this august publication. I worked on several interesting projects in 2014, but the one I want to talk about

            Comment


            • RobertHoehle
              RobertHoehle commented
              Editing a comment
              Ted, thank you! That is helpful.
          Working...
          X