IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Record Extraction Mismatch from Header


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sri_gans

New User


Joined: 03 Nov 2007
Posts: 10
Location: Chennai

PostPosted: Mon Dec 08, 2014 8:23 am
Reply with quote

Hello List,

I have coded an REXX to read the "Header page" "C A C H E D E V I C E A C T I V I T Y" . When the REXX has been executed this is working fine in extracting the required data, but when the new header is appearing as "C A C H E S U B S Y S T E M A C T I V I T Y" in the source file data is been taken from here.

For E.g in the Header page of "C A C H E D E V I C E A C T I V I T Y" the values supposed to extracted based on my REXX code as below;

VOLSER D3101B
TOTAL I/O 502
CACHE I/O 502

But, this been extracted from the Header "C A C H E S U B S Y S T E M A C T I V I T Y" and the values are showing as;

VOLSER D3101B
TOTAL I/O 842074
CACHE I/O 842074

This mismatch of report extraction is happening only where ever Header "C A C H E S U B S Y S T E M A C T I V I T Y" is been followed by "C A C H E D E V I C E A C T I V I T Y" .

I am trying to understand where the problem is exactly in my code. kindly let me know your suggestions please..

Below is the REXX which I have used:
-----------------------------------------

/*--------------------------------------------------------------------*/
/* LOAD THE WHOLE REPORT INTO STORAGE */
/*--------------------------------------------------------------------*/
"EXECIO * DISKR FILEIN (FINIS STEM LINE."

rtime = ""
DO I = 1 TO LINE.0

/*--------------------------------------------------------------------*/
/* LOOK FOR THE HEADER PAGES */
/*--------------------------------------------------------------------*/

card = LINE.I
IF POS('C A C H E D E V I C E A C T I V I T Y',card)<>0 THEN
CALL CAPTURE_TIME

/*-----------------------------------------------------------------*/
/* LOOK FOR I /O COUNT DETAILS */
/*-----------------------------------------------------------------*/
IF WORD(card,1) = 'VOLSER' & WORD(card,3) = 'NUM' THEN CALL VOLSER
IF WORD(card,1) = '0TOTAL' & WORD(card,4) = 'CACHE' THEN CALL TOTAL_IO
IF WORD(card,5) = 'I/O' & WORD(card,7) = 'CACHE' THEN CALL CACHE_IO
IF WORD(card,1) = '0NORMAL' THEN CALL NORMAL_RD
IF WORD(card,1) = 'SEQUENTIAL' & WORD(card,8) /= 'DFW ' THEN CALL SE_RD
IF WORD(card,1) = 'CFW' & WORD(card,7) /= 'ASYNC' THEN CALL CF_RD
IF WORD(card,1) = '0TOTAL' & WORD(card,3) /= 'RATE' THEN CALL TOTAL_VL
END
EXIT(0)

CAPTURE_TIME:

IF rtime = "" THEN
DO

/*------------------------------------------------------------------*/
/*HEADING: CONSTRUCTS THE COLUMN HEADINGS */
/*------------------------------------------------------------------*/
QUEUE ' TOTALI/O NORMAL SEQUENCE',
' CFW TOTAL_VALUE'
QUEUE 'DATE TIME VOLSER TOT CACHE RD_NRM WTE_NML SEQ_RD',
'SEQ_WR CF_RD CF_WR TOT_READ TOT_WRITE'
END
ELSE DO
/*--------------------------------------------------------------------*/
/* NOW WE HAVE ALL THE DATA LETS PRINT IT OUT */
/*--------------------------------------------------------------------*/
QUEUE rdate rtime' ' VOLSER_DE OUT_IO CACHE_OUT NRML_READ NRML_WRTE ,
SEQ_RD SEQ_WR CFW_RD CFW_WR TOT_RD TOT_WR
/*--------------------------------------------------------------------*/
/* OUTPUT THE RESULTS */
/* "ALLOC F(FILEOUT) DA(*)" */
/*--------------------------------------------------------------------*/
"EXECIO 1 DISKW FILEOUT"
END
/*--------------------------------------------------------------------*/
/* Extracts the coulmn values(Time and I/O ) */
/*--------------------------------------------------------------------*/
tt = i + 2
tcard = line.tt
rtime1 = SUBSTR(WORD(tcard,7),12,2)
rtime2 = SUBSTR(WORD(tcard,7),15,2)
rtime = rtime1 || ':' || rtime2

tt = i + 2
tcard = line.tt
/* parse var tcard 'CDATE' ddate 'INTERVAL'.*/
rdate1 = SUBSTR(WORD(tcard,7),1,10)
rdate = space(rdate1)
RETURN
END

TOTAL_IO:
OUT_IO = LEFT(WORD(card,3),7)
RETURN

VOLSER:
VOLSER_DE = LEFT(WORD(card,2),6)
RETURN

NORMAL_RD:
NRML_READ = LEFT(WORD(card,2),6)
NRML_WRTE = LEFT(WORD(card,7),6)
RETURN

SE_RD:
SEQ_RD = LEFT(WORD(card,2),6)
SEQ_WR = LEFT(WORD(card,7),6)
RETURN

CF_RD:
CFW_RD = LEFT(WORD(card,3),6)
CFW_WR = LEFT(WORD(card,8),6)
RETURN

TOTAL_VL:
TOT_RD = LEFT(WORD(card,2),6)
TOT_WR = LEFT(WORD(card,7),6)
RETURN

CACHE_IO:
CACHE_OUT = LEFT(WORD(card,6),6)
RETURN

END
Back to top
View user's profile Send private message
enrico-sorichetti

Senior Moderator


Joined: 14 Mar 2007
Posts: 10714
Location: italy

PostPosted: Mon Dec 08, 2014 10:53 am
Reply with quote

not a coding problem ... just a LOGIC one !

the three fields are repeated for both headers ...

just set a flag when You process the right header
and collect the data ONLY when the flag is on and turn it off after that
Back to top
View user's profile Send private message
sri_gans

New User


Joined: 03 Nov 2007
Posts: 10
Location: Chennai

PostPosted: Mon Dec 08, 2014 11:25 am
Reply with quote

Thank You Enrico. Understood your suggestion. let me try it.

But one point, which I am wondering is, In my code, I wanted to read only the Header "C A C H E D E V I C E A C T I V I T Y" but how this been getting bypassed and reading the values from different header "C A C H E S U B S Y S T E M A C T I V I T Y"..
Back to top
View user's profile Send private message
enrico-sorichetti

Senior Moderator


Joined: 14 Mar 2007
Posts: 10714
Location: italy

PostPosted: Mon Dec 08, 2014 11:55 am
Reply with quote

Quote:
... the values from different header "C A C H E S U B S Y S T E M A C T I V I T Y"..


that' s the point of my suggestion ...
since You do not check the sequence of headers
and the two headers are for the same <tokens>

the values You get are from the LAST occurrence of them
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compare the file record count percent... DFSORT/ICETOOL 2
No new posts Record count of RECFM=U tape file DFSORT/ICETOOL 17
No new posts Checking the total counts inside a re... JCL & VSAM 5
This topic is locked: you cannot edit posts or make replies. Splice JCL into one record for DD sta... SYNCSORT 2
No new posts Copying data from prev record using SORT SYNCSORT 19
Search our Forums:

Back to Top