PARM value not interpreted as expected

2019-08-20 17:34发布

Working in z/os mainframe, I have the following situation

1) That's my JCL, which I've submited:

 //PAYMENT JOB MSGCLASS=H                                                
 //******************************************************************    
 //*                                                                     
 //* This job can be used to run an MQ application that                  
 //* communicates with a transaction running in a CICS region.           
 //* The CICS transaction records a credit card payment in DB2.                                                                            
 //* The payment description has a maximum length of 35 characters.      
 //* It is enclosed within quotes below so that you may include          
 //* spaces to separate words.                                                                                                               
 //* The monetary values allowed by this tool must be within the         
 //* range 0.01 - 9999.99.                                                         
 //*                                                                     
 //******************************************************************    
 //PAYMENT  EXEC PGM=PAYMENT,REGION=1024K,                               
 //             PARM='CSQ1,CARD.PAYMENTS,CCD3050.REPLY,CCD3050,          
 //             400.05,"MY PAYMENT"'                                            
 //STEPLIB  DD DSN=CCD3050.PART2.LOAD,DISP=SHR    
 //         DD DSN=WMQ.V6R0.SCSQLOAD,DISP=SHR                            
 //         DD DSN=WMQ.V6R0.SCSQANLE,DISP=SHR                            
 //         DD DSN=WMQ.V6R0.SCSQAUTH,DISP=SHR                            
 //STDOUT   DD SYSOUT=*                                                  
 //STDERR   DD SYSOUT=*                                                  
 //SYSPRINT DD SYSOUT=* 

2) Looking at the job output in SDSF I see:

 IRR010I  USERID CCD3050  IS ASSIGNED TO THIS JOB.           
$HASP373 PAYMENT  STARTED - INIT 1    - CLASS A - SYS MVST  
IEF403I PAYMENT - STARTED - TIME=12.06.31                   
-                                         --TIMINGS (MINS.)-
-JOBNAME  STEPNAME PROCSTEP    RC   EXCP    CPU    SRB  CLOCK   SERV  PG   PAGE   SWAP    VIO SWAPS STEPNO 
-PAYMENT           PAYMENT     01     39    .00    .00    .00    122   0      0      0      0     0     1  
IEF404I PAYMENT - ENDED - TIME=12.06.31                     
-PAYMENT  ENDED.  NAME-                     TOTAL CPU TIME=   .00  TOTAL ELAPSED TIME=   .00
$HASP395 PAYMENT  ENDED  
0------ JES2 JOB STATISTICS ------ 
-  01 FEB 2014 JOB EXECUTION DATE  
-           55 CARDS READ    
-          111 SYSOUT PRINT RECORDS                                            
-            0 SYSOUT PUNCH RECORDS                                            
-            6 SYSOUT SPOOL KBYTES                                             
-         0.00 MINUTES EXECUTION TIME                                          
         1 //PAYMENT JOB MSGCLASS=H                                            
           //******************************************************************
           //*                                                                     
           //* This job can be used to run an MQ application that                  
           //* communicates with a transaction running in a CICS region.           
           //* The CICS transaction records a credit card payment in DB2.                                                                            
           //* The payment description has a maximum length of 35 characters.      
           //* It is enclosed within quotes below so that you may include          
           //* spaces to separate words.                                                                                                               
           //* The monetary values allowed by this tool must be within the         
           //* range 0.01 - 9999.99.                                                         
           //*                                                                     
           //******************************************************************    
         2 //PAYMENT  EXEC PGM=PAYMENT,REGION=1024K,                               
           //             PARM='CSQ1,CARD.PAYMENTS,CCD3050.REPLY,CCD3050,          
           //             400.05,"MY PAYMENT"'                                            
         3 //STEPLIB  DD DSN=CCD3050.PART2.LOAD,DISP=SHR    
         4 //         DD DSN=WMQ.V6R0.SCSQLOAD,DISP=SHR                            
         5 //         DD DSN=WMQ.V6R0.SCSQANLE,DISP=SHR                            
         6 //         DD DSN=WMQ.V6R0.SCSQAUTH,DISP=SHR                            
         7 //STDOUT   DD SYSOUT=*                                                  
         8 //STDERR   DD SYSOUT=*                                                  
         9 //SYSPRINT DD SYSOUT=*      
 ICH70001I CCD3050  LAST ACCESS AT 15:55:39 ON WEDNESDAY, JANUARY 29, 2014 
 IEF236I ALLOC. FOR PAYMENT PAYMENT                                        
 IGD103I SMS ALLOCATED TO DDNAME STEPLIB                                   
 IGD103I SMS ALLOCATED TO DDNAME                                           
 IGD103I SMS ALLOCATED TO DDNAME                                           
 IGD103I SMS ALLOCATED TO DDNAME                                           
 IEF237I JES2 ALLOCATED TO STDOUT                                          
 IEF237I JES2 ALLOCATED TO STDERR                                          
 IEF237I JES2 ALLOCATED TO SYSPRINT                                        
 IEF142I PAYMENT PAYMENT - STEP WAS EXECUTED - COND CODE 0001                   
 IGD104I CCD3050.PART2.LOAD                           RETAINED,  DDNAME=STEPLIB 
 IGD104I WMQ.V6R0.SCSQLOAD                            RETAINED,  DDNAME=        
 IGD104I WMQ.V6R0.SCSQANLE                            RETAINED,  DDNAME=        
 IGD104I WMQ.V6R0.SCSQAUTH                            RETAINED,  DDNAME=        
 IEF285I   CCD3050.PAYMENT.JOB03520.D0000101.?          SYSOUT                  
 IEF285I   CCD3050.PAYMENT.JOB03520.D0000102.?          SYSOUT                  
 IEF285I   CCD3050.PAYMENT.JOB03520.D0000103.?          SYSOUT                  
 IEF373I STEP/PAYMENT /START 2014036.1206 
 IEF374I STEP/PAYMENT /STOP  2014036.1206 CPU    0MIN 00.00SEC SRB    0MIN 00.00SEC VIRT    16K SYS   320K EXT     280K SYS   11012K 
 IEF375I  JOB/PAYMENT /START 2014036.1206                                       
 IEF376I  JOB/PAYMENT /STOP  2014036.1206 CPU    0MIN 00.00SEC SRB    0MIN 00.00SEC 

3) And then I see these messages:

********************************************************                        
Credit card payment unit test tool                        
********************************************************                        

Incorrect usage!                                                                

Program Usage                                                                   
-------------                                                                   

PAYMENT <queue manager> <cics request queue> <reply queue> <userid> <payment value> <payment description>

The payment description has a maximum length of 35 characters.                  

The monetary value must be within the range 0.01 - 9999.99.   

What am I doing wrong?

标签: zos jcl
1条回答
Melony?
2楼-- · 2019-08-20 18:07

The program you are using is doing you no favours. It is good practice for all programs which receive a PARM to show the value that has been passed to them.

Compile and execute this program, with the PARM exactly as you have specified it:

   ID DIVISION. 
   PROGRAM-ID. PROGNAME. 
   ENVIRONMENT DIVISION. 
   DATA DIVISION. 
   WORKING-STORAGE SECTION. 
   01  W-WHEN-COMPILED              PIC X(8)BX(8). 
   LINKAGE SECTION. 
   01  THE-PARM-FROM-THE-JCL. 
       05  TPFTJ-LENGTH             BINARY PIC 9(4). 
       05  TPFTJ-VALUE. 
           10  FILLER OCCURS 0 TO 100 TIMES 
               DEPENDING ON TPFTJ-LENGTH. 
               15  FILLER           PIC X. 
   PROCEDURE DIVISION USING 
                                    THE-PARM-FROM-THE-JCL
                                    . 
       MOVE WHEN-COMPILED           TO W-WHEN-COMPILED 
       DISPLAY "PROGNAME " W-WHEN-COMPILED 
       DISPLAY 
              ">" 
              TPFTJ-VALUE 
              "<" 
       GOBACK 
       . 

You should see this as your output:

PROGNAME followed by date-and-time-of-compile                                               
>CSQ1,CARD.PAYMENTS,CCD3050.REPLY,CCD3050,         400.05,"MY PAYMENT"<

You will see that chunk of blanks in the middle. That is your problem.

I don't know if you actually want the double-quotes around MY PAYMENT.

Assuming not, this would be one way to code your PARM:

//             PARM=('CSQ1,CARD.PAYMENTS,CCD3050.REPLY,CCD3050',
//             '400.05,MY PAYMENT') 

The above program will show you this value:

>CSQ1,CARD.PAYMENTS,CCD3050.REPLY,CCD3050,400.05,MY PAYMENT<

If you look at this, you'll see the problem and some resolutions described: http://publib.boulder.ibm.com/infocenter/zvm/v5r4/index.jsp?topic=/com.ibm.zos.r9.ieab100/jclexs.htm. This example is for the binder (IEWL). You should also consult the JCL Reference manual for your particular release of z/OS (although any one should do, I don't think PARM processing has changed under z/OS).

Continuations of PARM are tricky, because there are certain characters which have meanings to JCL. One way of continuing is to use up to column 71 and then continue in column 16. This is not very flexible. Enclosing the PARM value in parenthesis is more flexible. You also have several full-stops/periods, and those values need to be protected by single-quote pairs. The JCL Reference will detail all, and then you experiment with the above program to achieve full clarity.

查看更多
登录 后发表回答