Deployment Script

The pieces required for the K3S-GUI deployment are listed below. You may want to do command WRKSYSSTS before installing the GUI application to see how much open disk space you have.  We have noticed the GUI runs very slow when disk space is above 90%. 
*Note that we recommend the Chrome, Safari or Firefox browser to run all GUI customized screens. We also recommend a minimum monitor size of 20 inches. 

1) First, your Presto instance must be installed into the library K3S_PRESTO (not the default XL_PRESTO when you run XL_PRESTOI/BCDINSTALL). You will have to run the install twice to accomplish this.

2) Next, you need to edit the httpd.conf file in the IFS located in /www/k3s_presto/conf/
Change the top line to read: Listen 8035 (or Listen 80 if you do not use your iSeries as a web server)

3) You will need to run the following command before compiling K3S_RESTOR for the first time:
    CRTPF FILE(QGPL/K3S_ACTJOB) RCDLEN(132)

4) You will also need to create save file K3S_PRSAVF before running the deployment script for the first time:
    CRTSAVF FILE(QGPL/K3S_PRSAVF)

5) Note that all programs and text members should reside in QGPL/QCLSRC. These programs are listed below and the source is at the bottom of this page:
        CLP program K3S_PRSGET
        CLP program K3S_RESTOR
        CLP program K3S_ENDQCM
        TXT member K3S_PRSIN
        TXT member K3S_PRSOUT

6) After creating the programs described above, use WRKJOBSCDE to create a scheduled job to automatically pull the updates on a regular basis. We recommend calling this job K3S_5UPDPR and setting it to run weekly on Friday mornings. This job will need to perform a call to K3S_PRSGET.

7) Use option 10=Submit immediately and submit the K3S_5UPDPR job you created in step 6.  Note the first time you run this job it will blow up.  Go ahead and cancel the job once it blows up.  

8) After canceling the job that was submitted in the previous step, you will need to use WRKLNK and copy to

        /esdi/K3S_PRESTO/javascript/K3S_config.js 

to

        /esdi/K3S_config.js  



9) Use option 10=Submit immediate again on the K3S_5UPDPR job.  This time the job should complete successfully without errors. 

10) CLLE program K3S_SYSCL will need some adjustments. This program resides in the K3S modifications library, which is typically called K3S_5MOD.  You will need to add the 2 CLRMSGQ statements shown below. When you recompile this program, be sure to set the activation group parameter to *YES.  It is very important that you compile this program with DFTACTGRP set to *YES! 



11) You will need to make a change in order for the date pop-up calendar to work.  Pick one of two methods to make this happen. 
Method 1: Ensure that the following 3 fields in the K_USERPRF file are set accordingly for all buyers. Please notify the buyers before you make these changes. 

US_DATFMT = *USA    (this is required to make the pop-up date calendars work correctly)
US_DATESIX = 0          (this is required for date entry into the pop-up calendars to work correctly)
US_F3_WARN = 0        (this turns the F3=Exit warning window OFF) 

Method 2: If all users have fields US_DATFMT and US_DATESIX set exactly the same in file K_USERPRF, you can make modifications in the ISF for both /esdi/K3S_config.js and /esdi/K3S_PRESTO/javascript/K3S_config.js.  The following pictures show the before and after pictures if all users have US_DATFMT = *USA and US_DATESIX = 1 

(Note: You may need to clear your cache to pick up the changes in order for the pop up date calendar to work. To do this, hold down the shift key and press the refresh button in the toolbar of your browser)








12) Lastly, you will need to work with K3S to get a 'GUI-ized' version of the K3S_1050 and K3S_9257 screens. Because these screens reside in our modifications library, they must be individually GUI-ized for each customer. 
Also, if you do NOT have right adjusted product ID's, you will need to remove the CHECK(RB) attribute on the ZZ_PROD field. 



Optional steps: 

-You can add a user to the system called 'K3S_BUYERS' which will set the default user preference settings for all users added in the future. By adding the user K3S_BUYERS to the system, you don't have to remember to set the 3 user preference fields (US_DATFMT, US_DATESIX, and US_F3WARN) as previously mentioned.  To add K3S_BUYERS to the system, go into option 8. Management controls; 7. User preferences; press F6=Add to add a new user, then enter K3S_BUYERS as the User ID and set the user preference fields accordingly. Note that US_DATFMT refers to 'Date format'; US_DATESIX refers to 'Date entry' and US_F3_WARN is on page 2 of 2 and refers to 'F3 Exit warning window to be displayed' 

-If you re-IPL your server often, we suggest you add the following command to the IPL start up program QSTRUP in order to get the GUI back up and running:    
STRTCPSVR SERVER(*HTTP) HTTPSVR(K3S_PRESTO)

-You can install MMAIL (a free IBM email utility) on your server to enable reports to automatically email to the users in PDF and CSV file format. Contact K3S for more information on how to install this free utility on your server. 

-Contact K3S for a brief demonstration on navigating the GUI version of K3S.  Although there is no new training required when switching from the green screen to GUI version of K3S, this brief demo will highlight some of the important features only available with the graphical system. 

-The GUI version of K3S has a tool called 'Today's Agenda' on the main menu.  This tool is running SQL statements that can cause unexpected results when the AS/400 password is about to expire.  If your buyers have system passwords with expiration dates, then it is highly recommended that the users change their passwords ASAP when they start to get this warning message.  If your users do not have passwords with expiration dates, then you can ignore this recommendation. 




CLP program K3S_PRSGET

    PGM                                                         
   OVRDBF     FILE(INPUT) TOFILE(QGPL/QCLSRC) MBR(K3S_PRSIN)   
   OVRDBF     FILE(OUTPUT) TOFILE(QGPL/QCLSRC) MBR(K3S_PRSOUT) 
   FTP        RMTSYS('FTP.K3S.COM')                            
   CALL       PGM(QGPL/K3S_RESTOR)                             
   ENDPGM                                                      



CLP program K3S_RESTOR (before compiling this program you will need to run the following command: CRTPF FILE(QGPL/K3S_ACTJOB) RCDLEN(132))

               PGM                                                        
                                                                       
/*  DO BEFORE: CRTPF FILE(QGPL/K3S_ACTJOB) RCDLEN(132)            */   
             DCLF       FILE(QGPL/K3S_ACTJOB) RCDFMT(K3S_ACTJOB)       
             DCL        VAR(&JOBNAME) TYPE(*CHAR) LEN(10)              
             DCL        VAR(&USERNAME) TYPE(*CHAR) LEN(10)             
             DCL        VAR(&JOBNUM) TYPE(*CHAR) LEN(6)                
                                                                       
/*---  END THE PRESTO RELATED JOBS ----------------------------------*/
                                                                                                                                         
             ENDSBS     SBS(EXODUS51) OPTION(*IMMED)                     
             MONMSG     MSGID(CPF1054)                                 
             MONMSG     MSGID(CPF1055)                                 
                                                                       
             ENDTCPSVR  SERVER(*HTTP) HTTPSVR(K3S_PRESTO)              
             MONMSG     MSGID(TCP1A77)                                 
             ENDTCPSVR  SERVER(*WEBFACING)                            
                                                                      
 /*  END PRESTO JOBS IN QCMN                                       */ 
              CALL       PGM(QGPL/K3S_ENDQCM)                         
                                                                      
 /*  END PRESTO JOBS IN QUSRWRK                                    */ 
              OVRPRTF    FILE(QPDSPAJB) OUTQ(QEZJOBLOG)               
              WRKACTJOB  OUTPUT(*PRINT) SBS(QUSRWRK) JOB(K3S_PRESTO)  
              CPYSPLF    FILE(QPDSPAJB) TOFILE(K3S_ACTJOB) SPLNBR(*LAST)
                                                                      
  READ:       RCVF       RCDFMT(K3S_ACTJOB)                           
              MONMSG     MSGID(CPF0864) EXEC(GOTO CMDLBL(WAIT))       
              IF         COND(%SST(&K3S_ACTJOB 4 10) *EQ K3S_PRESTO) + 
                           THEN(DO)                                   
              CHGVAR     VAR(&JOBNAME) VALUE(%SST(&K3S_ACTJOB 4 10))  
              CHGVAR     VAR(&USERNAME) VALUE(%SST(&K3S_ACTJOB 17 10))
              CHGVAR     VAR(&JOBNUM) VALUE(%SST(&K3S_ACTJOB 29 6))   
              ENDJOB     JOB(&JOBNUM/&USERNAME/&JOBNAME) OPTION(*IMMED)
            ENDDO                                                     
              GOTO       CMDLBL(READ)                                 
                                                                      
  WAIT:       DLYJOB     DLY(40)                                      
                                                                      
 /*---  REPLACE K3S_PRESTO LIB WITH THE FRESH ONE ---------*/         
                                                                      
              DLTDTAQ    DTAQ(K3S_PRESTO/PR_CONVQ)                    
              MONMSG     MSGID(CPF2105)                   
            
 /*--**********************************************--------*/      
             
             GRTOBJAUT  OBJ(QGPL/PR_DEPLOY) OBJTYPE(*ALL) +   
                  USER(*PUBLIC) AUT(*ALL)             
                                                  
             GRTOBJAUT  OBJ(QGPL/K3S_PRSAVF) OBJTYPE(*ALL) +  
                  USER(*PUBLIC) AUT(*ALL)             
                                                  
             GRTOBJAUT  OBJ(K3S_PRESTO/*ALL) OBJTYPE(*ALL) +  
                  USER(*PUBLIC) AUT(*ALL)             

  /*--**********************************************--------*/                                                  
                                                            
              RSTOBJ     OBJ(PR_DEPLOY) SAVLIB(QGPL) DEV(*SAVF) +
              SAVF(QGPL/K3S_PRSAVF) MBROPT(*ALL) ALWOBJDIF(*ALL)                       
              
              MONMSG     MSGID(CPF3773)
                                                        
 
            RSTLIB     SAVLIB(K3S_PRESTO) DEV(*SAVF) +     
              SAVF(QGPL/PR_DEPLOY) MBROPT(*ALL) ALWOBJDIF(*ALL)                   
                      
              MONMSG     MSGID(CPF3773)                               
                                                                      
 /*---  RESTORE THE PRESTO IFS DIRECTORY                  ---------*/
                                                                      
              RST        DEV('/QSYS.LIB/K3S_PRESTO.LIB/PR_IFS.FILE') + 
                           OBJ(('/ESDI/K3S_PRESTO*')) SUBTREE(*ALL) + 
                           ALWOBJDIF(*ALL)                            
              MONMSG     MSGID(CPF383E) 

 /*---  RESTORE MODIFIED STUFF                            ---------*/  
          CPY        OBJ('/esdi/K3S_config.js') +                      
                       TOOBJ('/esdi/K3S_PRESTO/javascript/K3S_config.js') +       
                       REPLACE(*YES)                                   
                             
 /*---  START UP EXODUS SUBSYSTEM                         ---------*/
              STRSBS     SBSD(XL_EX51/EXODUS51)                       
                                                                      
 /*---  START UP PRESTO APACHE INSTANCE                   ---------*/
              STRTCPSVR  SERVER(*HTTP) HTTPSVR(K3S_PRESTO)            
              MONMSG     MSGID(TCP1A77)                               
              STRTCPSVR  SERVER(*WEBFACING)                           
                                                                      
 /*-----------------------------------------------------------------*/
  K3S_FINAL:  ENDPGM                                                  
                                                                      
        
                                        
                                                                      



CLP program K3S_ENDQCM

              PGM                                                     
                                                                      
 /*  DO BEFORE: CRTPF FILE(QGPL/K3S_ACTJOB) RCDLEN(132)            */ 
                                                                      
              DCLF       FILE(QGPL/K3S_ACTJOB) RCDFMT(K3S_ACTJOB)     
              DCL        VAR(&JOBNAME) TYPE(*CHAR) LEN(10)            
              DCL        VAR(&USERNAME) TYPE(*CHAR) LEN(10)           
              DCL        VAR(&JOBNUM) TYPE(*CHAR) LEN(6)              
              DCL        VAR(&MSG) TYPE(*CHAR) LEN(100)               
                                                                      
 /*  ************************************************************* */ 
 /*  END PRESTO JOBS IN QCMN                                       */ 
              OVRPRTF    FILE(QPDSPAJB) OUTQ(QEZJOBLOG)               
              WRKACTJOB  OUTPUT(*PRINT) SBS(QCMN) JOB(EXODUS51)         
              CPYSPLF    FILE(QPDSPAJB) TOFILE(K3S_ACTJOB) SPLNBR(*LAST)
                                                                      
  READ1:      RCVF       RCDFMT(K3S_ACTJOB)                           
              MONMSG     MSGID(CPF0864) EXEC(GOTO CMDLBL(WAIT1))      
            IF         COND(%SST(&K3S_ACTJOB 4 6) *EQ EXODUS51) +
              THEN(DO)      

              CHGVAR     VAR(&JOBNAME) VALUE(%SST(&K3S_ACTJOB 4 10)) 
              CHGVAR     VAR(&USERNAME) VALUE(%SST(&K3S_ACTJOB 17 10))
              CHGVAR     VAR(&JOBNUM) VALUE(%SST(&K3S_ACTJOB 29 6))  
              ENDJOB     JOB(&JOBNUM/&USERNAME/&JOBNAME) OPTION(*IMMED)
            ENDDO                                                    
              GOTO       CMDLBL(READ1)                               
                                                                     
  WAIT1:      DLYJOB     DLY(1)                                      
 /*  ************************************************************* */
                                                                     
              ENDPGM                                                 



TXT member K3S_PRSIN

 user id   password    (*contact K3S to get the user ID and password for your company)               
 bin                          
 get k3s_prsavf (replace      
 quit                         



TXT member K3S_PRSOUT

(just put 1 blank line in the member)



Manual Deploy Commands
If you have uploaded the SAVF manually to your iSeries into the QGPL directory you can use these three commands to restore the files.
*NOTE* You do NOT need to do this if you have the process setup automatically already. 

DLTDTAQ DTAQ(K3S_PRESTO/PR_CONVQ)

RSTOBJ OBJ(PR_DEPLOY) SAVLIB(QGPL) DEV(*SAVF) SAVF(QGPL/K3S_PRSAVF) ALWOBJDIF(*OWNER)

RSTLIB SAVLIB(K3S_PRESTO) DEV(*SAVF) SAVF(QGPL/PR_DEPLOY)

RST DEV('/QSYS.LIB/K3S_PRESTO.LIB/PR_IFS.FILE') OBJ(('/ESDI/K3S_PRESTO*')) SUBTREE(*ALL) ALWOBJDIF(*ALL)
Comments