ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Find the last day of the month

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

  • #16
    Re: Find the last day of the month

    This is from "change session defaults" in SEU, so I thought it was the right type...

    Source type . . . . . . . . . . . . CBLLE

    Comment


    • #17
      Re: Find the last day of the month

      Missy,

      Just guessing on this, try CRTPF for QCBLLESRC . This will create a different source PF. The code field (forget the name) is larger than QLBLSRC. Then put your code in QCBLLESRC.

      Let me know if that makes a difference.
      iSeriesCOBOL
      www.iseries-cobol.com

      Comment


      • #18
        Re: Find the last day of the month

        I had created a source physical and have just the one program in there.

        Comment


        • #19
          Re: Find the last day of the month

          Does SEU not accept FUNCTION? If not, post some of your code.
          iSeriesCOBOL
          www.iseries-cobol.com

          Comment


          • #20
            Re: Find the last day of the month

            No, I think it's not the word "function" anymore. It just says won't compile due to source statement errors. Before it was syntax error on the word function.

            Comment


            • #21
              Re: Find the last day of the month

              MissyMissy,

              It appears you have found that it was a different syntax problem.

              Just to piggyback on iSeriesCobol comments, when creating a source physical file using CRTSRCPF you should specify a record length of 112 for ILE source files. This gives you the newer length for those extra long lines of code that some ILE languages can utilize. We have changed our command default for CRTSRCPF to use the new length automatically. BTW, I think the longer length came around the V4R5/V5 timeframe, but I could be wrong.

              Terry

              Comment


              • #22
                Re: Find the last day of the month

                Sorry I didn't get back sooner, but I got this to run this morning. I did change the reccord legnth and there were syntax errors also. I don't know-must have been already off for holiday (mentally).

                Thanks to all of you for your help

                Comment


                • #23
                  Re: Find the last day of the month

                  I added this code to my SQLRPG program

                  c/exec sql Set :Today2 = Last_Day(:Today)
                  c/end-exec

                  /Free
                  Start_Date = %Char(Today:*ISO0);
                  End_Date = %Char(Toda2y:*ISO0);

                  and TODAY2 = 20070918.

                  Please advise. I am on V5R3.

                  DAC

                  Comment


                  • #24
                    Re: Find the last day of the month

                    BTW this is the cobol forum........

                    sometimes when I write posts on cooking websites...I try to imagine that all the people
                    reading my posts are not in the same room as me. I sometimes post the whole recipe of
                    the dish I have the question on as well as specific questions.

                    for example Im using this recipe and my sausages release excess fat when eatting
                    sometimes they squirt across the table and splash quests would it be a good idea
                    if I pricked the sausage links with a fork prior to serving?

                    * Servings: 6-8
                    * Level of difficulty: Intermediate
                    * Preparation Time: 20 minutes
                    * Cooking Time: 2 hours 20 minutes

                    Ingredients

                    * 12 pork sausages
                    * 115g unsalted butter
                    * 2 large onions, finely sliced
                    * 175g bacon lardons
                    * 225g cavalo nero, finely shredded
                    * 2 tbsp water
                    * 1.3kg King Edward or Maris Piper potatoes, peeled and finely sliced
                    * 2 tbsp thyme leaves
                    * 450ml double cream
                    * 300ml fresh beef stock
                    * 2 Bay leaves
                    * 2 egg yolks
                    * salt and fresh ground black pepper
                    * garlic bread, to serve

                    Method

                    1. Preheat the oven to 170°C/gas 3.

                    2. Heat a non-stick frying pan on the hob. Add sausages and fry gently until just browned. Remove from the pan and slice each sausage on the diagonal, lengthways, into three.

                    3. Meanwhile heat a large frying pan. Add the 55g of the butter and once melted add the onions. Cook the onions gently for 10 minutes or until soft and translucent. Remove from the pan and set aside.

                    4. Add the bacon lardons to the frying pan and cook for 3 4 minutes until golden and crispy. Add the Cavalo Nero with the water. Cook for 2-3 minutes or until the cabbage is soft, but still holding a little texture. Drain off any fat, remove from the pan and set aside.

                    5. Rub a large gratin dish (30cm x 21cm x 6cm) liberally with 25g of the butter. Place a layer of sliced potatoes in the bottom of the dish season with salt and freshly ground pepper and a sprinkling of the thyme. Top with a layer of sliced sausage, then a layer of cooked onion. Top with another layer of sliced potato and season with salt, freshly ground pepper and thyme. Spoon over the cooked Cavalo Nero and bacon. Top with another layer of potato slices and season again with salt, freshly ground pepper and thyme. Top with a layer of sliced sausage, then a layer of cooked onion and finally a layer of sliced potato. Season once again with salt, freshly ground pepper and thyme.

                    6. Pour the cream and stock into a pan and add the bay leaves. Place over a gently heat and bring to just below boiling point. Allow to cool slightly, then pour over the egg yolks and whisk to combine. Pour over the sausage and potato pie until the liquid just covers the top layer of potatoes. Dot over the remaining butter and cover with foil. Place the dish on a baking sheet. Place in the oven and cook for 1 hour 30 minutes.

                    7. Remove the foil from the dish and increase the oven temperature to 200°C/gas 6 and cook for a further 15 minutes or until the top is golden.

                    8. Serve immediately with garlic bread.
                    Wer is der Wurstkönig jetzt, Bitches?
                    Preheat oven for grilling/broiling sausages. Alternately sausages can be sautéed or barbequed too. In a large saucepan pour tomato sauce and mix all the ingredients other than the curry powder and the sausage. Cook over medium heat for 30 minutes after bringing to a boil.

                    Comment


                    • #25
                      Re: Find the last day of the month

                      David -- is Today defined as an *ISO date?
                      All my answers were extracted from the "Big Dummy's Guide to the As400"
                      and I take no responsibility for any of them.

                      www.code400.com

                      Comment


                      • #26
                        Re: Find the last day of the month

                        Yes, is it suppose to be a system date?

                        DAC

                        Comment

                        Working...
                        X