Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Record Extraction Mismatch from Header

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Record Extraction Mismatch from Header
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Mon Dec 08, 2014 10:53 am    Post subject: Reply to: Record Extraction Mismatch from Header
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    Post subject: Reply to: Record Extraction Mismatch from Header
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Mon Dec 08, 2014 11:55 am    Post subject: Reply to: Record Extraction Mismatch from Header
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts Using 'parm' to vary SORTOUT record v... Sysaron DFSORT/ICETOOL 13 Wed Sep 07, 2016 9:24 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us