report format



IBM's Command List programming language & Restructured Extended Executor

Re: report format

Postby Pedro » Fri Aug 29, 2014 10:49 pm

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.
Pedro Vera
User avatar
Pedro
 
Posts: 684
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: report format

Postby gn01277093 » Mon Sep 01, 2014 8:00 am

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
gn01277093
 
Posts: 11
Joined: Wed Jun 25, 2014 12:48 pm
Has thanked: 0 time
Been thanked: 0 time

Re: report format

Postby NicC » Mon Sep 01, 2014 11:20 am

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?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: report format

Postby gn01277093 » Mon Sep 01, 2014 3:29 pm

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.
gn01277093
 
Posts: 11
Joined: Wed Jun 25, 2014 12:48 pm
Has thanked: 0 time
Been thanked: 0 time

Re: report format

Postby Pedro » Tue Sep 02, 2014 9:20 pm

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.
Pedro Vera
User avatar
Pedro
 
Posts: 684
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Previous

Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post