Page 2 of 2

Re: report format

PostPosted: Fri Aug 29, 2014 10:49 pm
by Pedro
It is not clear what this means. Please elaborate:
I change "CPU"


Have you shown us all of the rexx program? It seems like there is something you are not showing us.

Please add a TRACE('R') to your program and show us the trace.

Re: report format

PostPosted: Mon Sep 01, 2014 8:00 am
by gn01277093
My JCL is
//@1MAIN   JOB SORT,CLASS=A,MSGCLASS=X,MSGLEVEL=(1,0),               
//         REGION=4M,COND=(4,LT),NOTIFY=&SYSUID,TIME=(0,10)           
//********************************************************************
//CALLREXX EXEC PGM=IKJEFT01                                         
//SYSEXEC  DD DISP=SHR,DSN=ES6LTHT.JCL.REXX                           
//FILEIN   DD DSN=SYSOPERT.MVSTRMF.SESSION3,DISP=SHR                 
//FILEOUT  DD DSN=ES6LTHT.SESSION,DISP=SHR                           
//SYSTSPRT DD SYSOUT=X                                               
//SYSTSIN  DD *                                                       
CPU                                                                   
/*         

and when I call REXX "ES6LTHT.JCL.REXX(CPU), I can run the JOB
'EXECIO * DISKR FILEIN (FINIS STEM DATA.'   
DO I=1 TO DATA.0                           
   IF SUBSTR(DATA.I,2,7) = "PRODUCT" THEN DO
      SAY " CPU:" SUBSTR(DATA.I,128,5)     
   END                                     
END                                         
EXIT                                       

But I call REXX "ES6LTHT.JCL.REXX(TEST)" , It show the Message "IKJ56701I MISSING DSNAME"
SAY "TIME:        CPU:      CSA:         ECSA:"   
'EXECIO * DISKR FILEIN (FINIS STEM DATA.'         
DO I=1 TO DATA.0                                 
line = ""                                         
   IF SUBSTR(DATA.I,1,4) = "-CPU" THEN DO         
      J = I - 1                                   
      line = SUBSTR(DATA.J,71,8)                 
   END                                           
   IF SUBSTR(DATA.I,2,7) = "PRODUCT" THEN         
      line = OVERLAY(SUBSTR(DATA.I,128,5),line,14)
   IF SUBSTR(DATA.I,34,5) = "BELOW" THEN DO       
      L = I + 5                                   
      line = OVERLAY(SUBSTR(DATA.L,39,5),line,24)
      line = OVERLAY(SUBSTR(DATA.L,79,4),line,37)
      SAY line                                   
   END                                           
END
EXIT                                               

Sorry, Could you teach me how to use TRACE('R').
Thanks

Re: report format

PostPosted: Mon Sep 01, 2014 11:20 am
by NicC
Sorry, Could you teach me how to use TRACE('R').

Is it SO difficult to read the Rexx manual?

Are you using the same JCL to run the exec TEST? If not, are you sure you have a FILE IN DD dtatement, and pointing to the correct dataset name?

Re: report format

PostPosted: Mon Sep 01, 2014 3:29 pm
by gn01277093
I found the problem is that I can't name the REXX "TEST", so I change its name "CPUCPU". I can run the job successfully.
"TEST" is TSO command or problems, I will find why I can't named it "TEST".
But when I ues the REXX
SAY "TIME:        CPU:      CSA:         ECSA:"       
'EXECIO * DISKR FILEIN (FINIS STEM DATA.'             
DO I=1 TO DATA.0                                     
   line = ""                                         
   IF SUBSTR(DATA.I,1,4) = "-CPU" THEN DO             
      J = I - 1                                       
      line = SUBSTR(DATA.J,71,8)                     
   END                                               
   IF SUBSTR(DATA.I,2,7) = "PRODUCT" THEN             
      line = OVERLAY(SUBSTR(DATA.I,128,5),line,14)   
   IF SUBSTR(DATA.I,34,5) = "BELOW" THEN DO           
      L = I + 5                                       
      line = OVERLAY(SUBSTR(DATA.L,39,5),line,24)     
      line = OVERLAY(SUBSTR(DATA.L,79,4),line,37) 
      SAY line   
   END                                               
END                                                   
EXIT             

The result will be
TIME:        CPU:      CSA:         ECSA:
                             1104K        307M
                             1104K        307M
                             1104K        307M
                             1104K        307M

It can't show TIME and CPU's value, So I delete
line = ""

I can run the JOB successfully and it can show the true value.
Thank for everybody's help.
My English is not well, so I can't express what I mean clearly.
Please forgive me.

Re: report format

PostPosted: Tue Sep 02, 2014 9:20 pm
by Pedro
I think you still need:
   line = "" 

It should be immediately before the EXECIO statement and also again immediately after SAY LINE.

You want to initialize it each time in case there is a missing input record. Clearing the line ensures that you do not have data from an unrelated set of records.