report format



IBM's Command List programming language & Restructured Extended Executor

report format

Postby gn01277093 » Tue Aug 12, 2014 1:22 pm

Please help me. My report format is
     TIME:  00.00.07
 CPU: 26.56         
 CSA: 1088K         
ESSA: 329M         
     TIME:  01.00.00
 CPU: 82.65         
 CSA: 1088K         
ESSA: 329M         
     TIME:  02.00.00
 CPU: 43.31         
 CSA: 1088K         
ESSA: 329M     


But I want to the report is
TIME:        CPU:      CSA:         ECSA:
00.00.07   26.56     1088K       329M
01.00.00   82.65     1088K       329M
02.00.00   43.31     1088K       329M


How should I do ,thanks.

code:
'EXECIO * DISKR FILEIN (FINIS STEM DATA.'   
DO I=1 TO DATA.0                             
   IF SUBSTR(DATA.I,1,4) = "-CPU" THEN DO   
      J = I - 1                             
      SAY "     TIME: " SUBSTR(DATA.J,71,8) 
   END                                       
   IF SUBSTR(DATA.I,2,7) = "PRODUCT" THEN DO
      SAY " CPU:" SUBSTR(DATA.I,128,5)       
   END                                       
   IF SUBSTR(DATA.I,34,5) = "BELOW" THEN DO 
      L = I + 5                             
      SAY " CSA:" SUBSTR(DATA.L,39,5)       
      SAY "ESSA:" SUBSTR(DATA.L,79,4)       
   END                                       
END                                         
EXIT
gn01277093
 
Posts: 11
Joined: Wed Jun 25, 2014 12:48 pm
Has thanked: 0 time
Been thanked: 0 time

Re: report format

 

Re: report format

Postby Pedro » Tue Aug 12, 2014 9:32 pm

It looks you like you want one line with four values. But your code has four different SAY statements, which will result in four different lines.

What you want is to check the current line and to save the value to one of four program variables. Only when you encounter a 'ESSA' line, use one SAY statement that has all four variables.
Pedro Vera
User avatar
Pedro
 
Posts: 569
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 39 times

Re: report format

Postby NicC » Wed Aug 13, 2014 3:54 pm

It makes it much easier for people to help you if they can easily read your post. To this end you should code your data and code. I have done it for you this time but, in future, please do it yourself.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: report format

Postby Steve Coalbran » Mon Aug 25, 2014 11:53 am

something like this perhaps?
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             
I haven't checked the column positions and can't check as I don't have your 'DATA'.
Steve
User avatar
Steve Coalbran
 
Posts: 102
Joined: Wed Apr 06, 2011 11:49 am
Location: Stockholm, Sweden
Has thanked: 5 times
Been thanked: 1 time

Re: report format

Postby gn01277093 » Tue Aug 26, 2014 1:34 pm

When I submit the Job
CALLREXX Log show the Message
"IKJ56701I MISSING DSNAME"


Steve Coalbran wrote:something like this perhaps?
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             
I haven't checked the column positions and can't check as I don't have your 'DATA'.
gn01277093
 
Posts: 11
Joined: Wed Jun 25, 2014 12:48 pm
Has thanked: 0 time
Been thanked: 0 time

Re: report format

Postby NicC » Tue Aug 26, 2014 4:03 pm

Did you actually allocate the dataset?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: report format

Postby gn01277093 » Wed Aug 27, 2014 11:12 am

Yes. I have other REXX jobs. In JCL, I only change the REXX name and to submit the jobs.
gn01277093
 
Posts: 11
Joined: Wed Jun 25, 2014 12:48 pm
Has thanked: 0 time
Been thanked: 0 time

Re: report format

Postby Pedro » Wed Aug 27, 2014 7:01 pm

In JCL, I only...

Did you allocate the DD name in your JCL? The JCL is asynchronous from your TSO session. Any allocation in TSO does not apply to the batch job.
Pedro Vera
User avatar
Pedro
 
Posts: 569
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 39 times

Re: report format

Postby Pedro » Wed Aug 27, 2014 9:04 pm

'EXECIO * DISKR FILEIN (FINIS STEM DATA.'

Show us where / how you allocate FILEIN.
Pedro Vera
User avatar
Pedro
 
Posts: 569
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 39 times

Re: report format

Postby gn01277093 » Fri Aug 29, 2014 10:39 am

//@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                                                                   
/*                                                                   

I change "CPU"
Thanks
gn01277093
 
Posts: 11
Joined: Wed Jun 25, 2014 12:48 pm
Has thanked: 0 time
Been thanked: 0 time

Next

Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post