Page 1 of 1

Call PGM

Posted: Thu Oct 18, 2012 11:46 am
by kaw
I want to call a program (RPG or CL) for a given group with Atrium, but an error that appears after test. Can you help me?
Thank you in advance!

Re: Call PGM

Posted: Thu Oct 18, 2012 12:55 pm
by Scott Klement
Sure. Can you provide more information about what you've done, and what error it causes?

Thanks!

Re: Call PGM

Posted: Fri Oct 19, 2012 5:05 am
by kaw
Note that these programs work when I'm on profound.

Here are the catches to call a CL program.
Configuration in Atrium:
err cl.png
err cl.png (19.45 KiB) Viewed 4659 times
Error message that appears when I run the program in the user account that I created.
message err.png
message err.png (92.52 KiB) Viewed 4659 times
Erro message:
Cause. . . . . : The file has not been opened. The reason code is 03. Different reason codes and their meanings are as follows: 01 - The library does not exist. 02 - The file does not exist. The library exists. 03 - The file does not exist. The library is represented by the value * LIBL. 04 - File saved with freeing memory. 07 - No spool file input. 08 - A disk file is opened with the input SPOOL (* YES) for a read operation, but there is no spool file input. 10 - No file on the remote system. 11 - No library on the remote system. 14 - The member was saved with free memory on the remote system. What to do. . . : Do one of the following based on the reason code shown, then repeat the application: 01 - Change the name of the library using a command substitution, or create a library (CRTLIB control) and a file with an appropriate name. 02 - Change the file name, the library, or both, using the appropriate command substitution. 03 - Add the library to the library list (ADDLIBLE command) or change the file name, the library, or both, using an appropriate substitution command. 04 - Restore the file (control RSTOBJ) or change the file name, the library, or both, using an appropriate substitution command. 07 - Add a spooled file input (DATA command) or change the file name, the library, or both, using the appropriate command substitution. 08 - Enter the value * NO for the parameter in the command SPOOL OVRDKTF (Substitute a disk file), or add a spool

Re: Call PGM

Posted: Fri Oct 19, 2012 5:18 am
by kaw
Note that these programs work when I'm on profound.

Here are the catches to call a RPG program.
Configuration in Atrium:
config program RPG.png
config program RPG.png (19.07 KiB) Viewed 4659 times
Error message that appears when I run the program in the user account that I created.
message err RPG.png
message err RPG.png (75.17 KiB) Viewed 4659 times
Error message:
Cause. . . . . : The procedure Mytest RPG program DASOW / Mytest received the message CPF4101 at an implicit OPEN operation on file SCREEN. The actual file is SCREEN. What to do. . . : See the complete description of message CPF4101 in the job history and contact the person responsible for software maintenance. If the device type associated with the file is SPECIAL, it may work history contains no message.

Re: Call PGM

Posted: Fri Oct 19, 2012 12:06 pm
by Scott Klement
The error message is that it can't find a file named ECRAN in your library list.

Perhaps from the PUI environment you were calling a CL program that adds a library to the library list prior to calling the RPG? and from Atrium you're calling the RPG directly? (This is just a guess, I may be wrong.)

Can you tell me a little more about how your program attempts to set up it's library list?

Re: Call PGM

Posted: Fri Oct 19, 2012 12:57 pm
by kaw
I created a simple RPG program displays a screen and the user enters the registration number and the name and surname appears when the user presses Enter.
I put the object in a library MyBIB.
RPG code:

Code: Select all

FECRAN     CF   E             WorkStn                       
                                                            
 /free                                                      
    dow *IN03 = *off;                                       
      EXFMT POINT;                                           
      IF *IN03 = *OFF;                                       
         IF NOT(wMatric =0);            
         Exec SQL                                           
              Select  NOM, PRENOM  INTO  :NOM, :PRENOM      
              FROM EMP                                      
              WHERE MATRIC = :wMatric;                      
            IF NOT(NOM = *BLANKS) AND NOT(PRENOM = *BLANKS);
               EXFMT POINT;                                 
            ENDIF;                                          
          ENDIF;                                            
      ENDIF;                                                
   enddo;

Re: Call PGM

Posted: Fri Oct 19, 2012 4:45 pm
by Scott Klement
Your ECRAN file does not appear to be a rich display file. It's a 5250 screen, and so would need to be opened in Genie, or in a green-screen session.

If you have the Genie product available, you can set up a macro that will sign on to a 5250 session and run the program you've provided. This can be executed from your Atrium menu. The process to start up and run a green-screen program in Genie from Atrium is described here:
http://www.profoundlogic.com/docs/displ ... cros+Panel

You are trying to run it as if it's a rich display. But, I can see it's not a rich display, because it doesn't have the HANDLER keyword on the F-spec, or the /define that triggers the precompiler. So must be a green-screen app.

Since it doesn't look like you have your library list set up (as I said in a previous message) if this is, indeed, supposed to be a rich display, you'll need to get that set up. But, this probably isn't needed if you're running it as a green screen in Genie. (Or, at least, the procedure is different.)

Let me know if that helps.

Re: Call PGM

Posted: Mon Oct 29, 2012 5:05 am
by kaw
I tested with a rich screen and it worked. Thank you!