ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Cpf2592 - Emergency

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cpf2592 - Emergency

    hI GUYS,

    Need help regarding in the CPF2592.

    This is the error message I encountered:

    Control language (CL) program CS364C02 in library CSLIB detected an error at statement number 3800, Message text for CPF2952 is: Error opening file CS364W in library CSLIB.

    Can you give me reason why this error occur?

  • #2
    Re: Cpf2592 - Emergency

    You need to look at the job log. Prior to this entry, another error message will be logged with the actual problem. Typically this occurs when a file is not available (locked by another pgm) or the file doesn't exist or the user doesn't have authority to access.

    Comment


    • #3
      Re: Cpf2592 - Emergency

      Is the solution is to add monmsg in the CL program?

      Comment


      • #4
        Re: Cpf2592 - Emergency

        Thats what arrow was saying -- we have no idea what the actual problem is -- You didnt provide enough information.

        the answer is NOT to add a monmsg.....

        can you post some code?

        also we need to see the joblog.......if you take a "D" to the error message it will
        print a spooled file to QEZJOBLOG there you can grab and post.

        also please make sure that CS364W is in lib CSLIB

        wrkobj CSLIB/CS364W


        is there an ovrdbf in your program???

        thanks
        jamie
        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


        • #5
          Re: Cpf2592 - Emergency

          Originally posted by jamief View Post
          the answer is NOT to add a monmsg.....
          Are you sure? I always thought the best way to write a program was with lots of monmsg. Example of a end of day/end of month/etc pgm:

          inztap
          monmsg cpf0000

          savlib
          monmsg cpf0000

          call purgepgm
          monmsg cpf0000

          http://www.linkedin.com/in/chippermiller

          Comment


          • #6
            Re: Cpf2592 - Emergency

            Hi Chipper:

            Using your code above
            What happens if the inztap fails?

            The savlib fails but the purge program runs......OOPs

            Best of Luck
            GLS
            The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

            Comment


            • #7
              Re: Cpf2592 - Emergency

              I think that was Chipper's point he was being sarcastic..
              which by the way I really enjoy.

              Happy Friday ALL!
              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


              • #8
                Re: Cpf2592 - Emergency

                I don't beleive I fell into that one.

                Where is the Icon with egg on it's face?

                I'll just blame the cold weather here and hope no-one actually read my post.

                [hanging head in shame]
                gls
                The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

                Comment


                • #9
                  Re: Cpf2592 - Emergency

                  I only half read it...(I closed one eye). But laughing takes TWO lungs
                  Your future President
                  Bryce

                  ---------------------------------------------
                  http://www.bravobryce.com

                  Comment


                  • #10
                    Re: Cpf2592 - Emergency

                    Originally posted by jamief View Post
                    I think that was Chipper's point he was being sarcastic..
                    which by the way I really enjoy.

                    Happy Friday ALL!
                    Yes -- but sarcastic in a "tongue in cheek, give people a chuckle" way as opposed to sarcastic in a "put down" way. As somebody who has just recently begun posting on this board, one of the things I have found great is the humorous banter that goes back and forth between many of the forum members.

                    Happy Friday to jamie & everyone as well.
                    http://www.linkedin.com/in/chippermiller

                    Comment


                    • #11
                      Re: Cpf2592 - Emergency

                      Originally posted by Chipper View Post
                      monmsg cpf0000
                      inztap

                      savlib

                      call purgepgm
                      Hey chipper, you can save lots of time if u nake your monmsg global
                      Regards

                      Kit
                      http://www.ecofitonline.com
                      DeskfIT - ChangefIT - XrefIT
                      ___________________________________
                      There are only 3 kinds of people -
                      Those that can count and those that can't.

                      Comment


                      • #12
                        Re: Cpf2592 - Emergency

                        Originally posted by kitvb1 View Post
                        Hey chipper, you can save lots of time if u nake your monmsg global
                        That was also part of the intent behind the silly post.
                        http://www.linkedin.com/in/chippermiller

                        Comment


                        • #13
                          Re: Cpf2592 - Emergency

                          Monmsg isn't exactly a bad thing.

                          Monmsg should be used, maybe even in the above case of savlib - but not CPF0000 :-). Specific errors may be monitored for and HANDLED - as in getting some message out to the user to let him know what might have gone wrong.

                          Not doing anything after MONMSG is the same as giving an IGNORE instruction. This is best done for warning messages that you are sure will not affect the rest of the program flow.

                          For the initial problem in the thread, unless you want to handle this error programmatically, have a look at the job log and find out what the exact reason for the file not opening is. Correct that and resubmit.
                          â??No bird soars too high if he soars with his own wingsâ?? â?? William Blake

                          Comment


                          • #14
                            Re: Cpf2592 - Emergency

                            Originally posted by kausix777 View Post
                            Monmsg isn't exactly a bad thing.

                            Monmsg should be used, maybe even in the above case of savlib - but not CPF0000 :-). Specific errors may be monitored for and HANDLED - as in getting some message out to the user to let him know what might have gone wrong.
                            I agree, and here's one that is useful cos I hate restore/backup programs that fail with the message "167 objects saved/restored, 0 not saved. reply (RICD)" as I fail to see why a successful save/restore should break a message to the screen and want action !!!!

                            Basically the code below (which is a bit thrown together and can prob be improved) intercepts the response from the save or restore command (below this is RST for a restore from a save file to the IFS) and then validates the number of objects restored etc, in my case below we always want 3 restored so it is hard coded.

                            This can be changed easily to suit other validations, normally just &MVD2 = 0 is enough as that is 0 not restored (or 0 not saved etc) . . .

                            Code:
                                         DCL        VAR(&MTXT1)   TYPE(*CHAR) LEN(132)
                                         DCL        VAR(&MSGID)   TYPE(*CHAR) LEN(7)  
                                         DCL        VAR(&MSGDATA) TYPE(*CHAR) LEN(8)  
                                         DCL        VAR(&MSGDLEN) TYPE(*DEC)  LEN(5 0)
                                         DCL        VAR(&MVD1)    TYPE(*DEC)  LEN(9 0)
                                         DCL        VAR(&MVD2)    TYPE(*DEC)  LEN(9 0)
                                         DCL        VAR(&MVC1)    TYPE(*CHAR) LEN(1)  
                                         DCL        VAR(&MVC2)    TYPE(*CHAR) LEN(1)  
                            
                            /* ----> Restore the Jaywalk updates from the LJyymmdd/JUyymmdd SAVF          */
                            /* RST   DEV('qsys.lib/LJYYMMDD.lib/JUYYMMDD.file')                           */
                            /*       OBJ(('/JWkDpl/ICMSUYYMMDD' *INCLUDE '/icmsjwk'))                     */
                            /*       OUTPUT(*PRINT) ALWOBJDIF(*ALL)                                       */
                                         CHGVAR     VAR(&DEVSTR) VALUE(&QT *TCAT 'qsys.lib/' +              
                                                      *TCAT &FLTLIB *TCAT '.lib/' *TCAT &ODOBNM +           
                                                      *TCAT '.file' *TCAT &QT)                              
                                         CHGVAR     VAR(&OBJNAME) VALUE('ICMSU' *TCAT %SST(&FLTLIB +        
                                                      3 6))                                                 
                                         CHGVAR     VAR(&OBJSTR) VALUE(&QT *TCAT '/JWkDpl/' +               
                                                      *TCAT &OBJNAME *TCAT &QT)                             
                                         CHGVAR     VAR(&TGTFLDR) VALUE(&QT *TCAT '/icmsjwk' +              
                                                      *TCAT &QT)                                            
                                         RST        DEV(&DEVSTR) OBJ((&OBJSTR *INCLUDE +                    
                                                      &TGTFLDR)) OUTPUT(*PRINT) ALWOBJDIF(*ALL)             
                                         MONMSG CPF383E                                                     
                            
                            /* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
                            /* --- &MSGTXT  for CPC370F is '&1 objects restored.'                         */
                            /* --- &MSGDATA for CPC370F is length 8 so we strip out 2 at length 4         */
                            /* --- &MSGTXT  for CPF383E is '&1 objects restored. &2 not restored.'        */
                            /* --- &MSGDATA for CPF383E is length 8 so we strip out 2 at length 4         */
                            /* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
                             SUBMSG:     RCVMSG     MSGQ(*PGMQ) MSGTYPE(*LAST) MSG(&MTXT1) +                
                                                      MSGDTA(&MSGDATA) MSGDTALEN(&MSGDLEN) +                
                                                      MSGID(&MSGID)                                         
                                         CHGVAR     VAR(&MVD1) VALUE(%BIN(&MSGDATA 1 4))                    
                                         CHGVAR     VAR(&MVD2) VALUE(%BIN(&MSGDATA 5 4))                    
                                         CHGVAR     VAR(&MVC1) VALUE(&MVD1)                                 
                                         CHGVAR     VAR(&MVC2) VALUE(&MVD2)                                 
                                         CHGVAR     VAR(&ERRMSG) VALUE(&MVC1 *TCAT ' Jaywalk +              
                                                      objects restored,' *BCAT &MVC2 *TCAT ' +              
                                                      Jaywalk Objects NOT RESTORED. Reply +                 
                                                      anything to continue.')                               
                                         SNDPGMMSG  MSG(&MTXT1)                                             
                                         SNDPGMMSG  MSG(&ERRMSG)                                            
                                         IF         COND((&MVD1 *EQ 3) *AND (&MVD2 *EQ 0)) +                
                                                      THEN(GOTO CMDLBL(JWALKOK))                            
                                         SNDUSRMSG  MSG(&ERRMSG) TOUSR(&USER)
                            Greg Craill: "Life's hard - Get a helmet !!"

                            Comment

                            Working...
                            X