As/400 Job number ..Two part question

345 pts.
Tags:
AS/400 jobs
Command line
CPYSPLF
CPYTOPCD
Hi all, We are in the process of implementing online paystubs for employees to view. Here are the steps that I am trying to automate from the IT side of the house. 1) Clrpfm 2) cpysplf 3) cpytopcd So far..number to is the issue due to not knowing what the job number will be in advance. I have created the above steps in our ICOM program and it is set to trigger when the check spool file hits the outq. Is there a simple way of handling this issue? We use Sungard software and we cannot modify their programs. If this is not easily doable....my next question. Can I give the payroll person command line access and restrict the commands that she can enter? Any help with this will be greatly appreciated!!! Rick

Answer Wiki

Thanks. We'll let you know when a new response is added.

Yes, you want to get a file/list of the spool files in an outq
this could be done in two steps
1. WRKOUTQ OUTQ(youroutq) OUTPUT(*PRINT)
when you look at this
Read each record from this file you will find
user(13-22)
job (84-94)
number(95-100)
Spool file # 72-78
1.a or you could use WRKSPLF OUTPUT(*PRINT) — layout is a little different
2. copy this spool file to a physical file – easy this is the first spool file of this job.
3. read each row in the file

4. if the spool file is one you want extract the fields needed.

I’m sure someone else has some handy tools or API’s the make this easier.

Phil

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Rmason
    Thanks Phil, Could you give me the CL commands needed to accomplish your suggestions? I am not progam savey :) Thanks in advance!!
    345 pointsBadges:
    report
  • Gilly400
    Hi, In response to part two of your question. You have several options to achieve this - mostly depending on how many commands your payroll person will need access to. You could create your own menu with only the commands she needs on it. You could give her command line access and use object level security to revoke all commands except for the ones that your payroll person needs to use. The security on the machine is very flexible, but can be a little daunting at first. The quick and easy method is probably going to be a menu. I'm sure others will have more methods for getting this done, but these are probably two of the most commonly used. Regards, Martin Gilbert.
    23,730 pointsBadges:
    report
  • philpl1jb
    /* TO COMPILE FILE QMYFILE MUST BE CREATED IN WORKLIB */                
    /* WITH CMD:  CRTPF      FILE(WORKLIB/QMYFILE) RCDLEN(132) */           
    PGM                                                                     
     DCL  &FILENAME *CHAR 10                                                
     DCL  &JOB      *CHAR 10                                                
     DCL  &USER     *CHAR 10                                                
     DCL  &JOBNUM   *CHAR  6                                                
     DCL  &SPLNBR   *CHAR 10                                                
     DCLF QMYFILE                                                           
                                                                            
     /* prepare work file */                                                
     DLTF   WORKLIB/QMYFILE                                                 
     MONMSG CPF0000                                                         
     CRTPF      FILE(WORKLIB/QMYFILE) RCDLEN(132)                           
                                                                            
     /* get list of spool files into workfile */                            
     WRKOUTQ OUTQ(OUTQNAME) OUTPUT(*PRINT)                                  
     CPYSPLF    FILE(QPRTSPLQ) TOFILE(WORKLIB/QMYFILE)      
    /* read each row in workfile and process */                                  
    LOOP:                                                                        
       RCVF                                                                      
       MONMSG     MSGID(CPF0864) EXEC(GOTO CMDLBL(END))                          
          chgvar  &FILENAME  (%SUBSTRING( &QMYFILE   2   10))                    
          chgvar  &JOB       (%SUBSTRING( &QMYFILE  84   10))                    
          chgvar  &USER      (%SUBSTRING( &QMYFILE  13   10))                    
          chgvar  &JOBNUM    (%SUBSTRING( &QMYFILE  95    6))                    
          chgvar  &SPLNBR    (%SUBSTRING( &QMYFILE  72   10))                    
                                                                                 
          if (&FILENAME = 'YourSpol') do   /*   'put in spoolfile name  */       
            /* do your stuff */                                                  
            clrpfm (yourlib/yourfile)                                            
            CPYSPLF    FILE(&FILENAME) TOFILE(YOURLIB/YOURFILE) +                
                             JOB(&JOBNUM/&USER/&JOB) SPLNBR(&SPOOLN)             
            cpytopcd    ... your stuff here                                      
                                                                                 
       GOTO LOOP     
                     
                     
    END: ENDPGM
    51,365 pointsBadges:
    report
  • Rmason
    Thanks guys...HAPPY HOLIDAYS!!!!!!
    345 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following