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

Get Previous record for matching current record


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Sathish Gurumoorthy

New User


Joined: 12 Feb 2009
Posts: 33
Location: Chennai, India

PostPosted: Tue Jul 19, 2011 10:36 pm
Reply with quote

I have below CICS log which have information about what had happened in Online screens.

Code:
---------1---------2---------3---------4---------5--------6---------7---------8
REQUEST  18/07/2011 18:55:53 F02 G974650 223856902
RESPONSE 18/07/2011 18:55:54                       
REQUEST  18/07/2011 18:56:20 F02 G990101 579364447
RESPONSE 18/07/2011 18:56:20                       
REQUEST  18/07/2011 18:58:19 F02 G974606 789334456
RESPONSE 18/07/2011 18:58:19                       ABEND  SQL CODE: 803
REQUEST  18/07/2011 19:00:46 F02 G974890 323144410
RESPONSE 18/07/2011 19:00:47                       
REQUEST  18/07/2011 19:02:23 F02 G974650 112874160
RESPONSE 18/07/2011 19:02:23                       ABEND  SQL CODE: 803
REQUEST  18/07/2011 19:03:38 F02 G974601 032657752
RESPONSE 18/07/2011 19:03:38                       


In Production, customer support guys were trying to create Insurance policies and it fails with SQL Code 803. We found the cause for sql error .

But, we need to know for what customers it failed.
Position 42-50 have customer id in REQUEST record
Position 60-72 have the error 'SQL CODE: 803' in RESPONSE record

I want to get the Customer Id from REQUEST record for the SQL CODE 803 in RESPONSE record.

The output should be like this
Code:
789334456
112874160


I've tried using Splice and other methods, but no luck.I've searched this forum for similar posts, but couldn't find any.

Please help.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Tue Jul 19, 2011 10:55 pm
Reply with quote

See if below helps. Assuming input is FB/80.

Code:
//STEP0001 EXEC PGM=SORT                                               
//SORTIN   DD  *                                                       
REQUEST  18/07/2011 18:55:53 F02 G974650 223856902                     
RESPONSE 18/07/2011 18:55:54                                           
REQUEST  18/07/2011 18:56:20 F02 G990101 579364447                     
RESPONSE 18/07/2011 18:56:20                                           
REQUEST  18/07/2011 18:58:19 F02 G974606 789334456                     
RESPONSE 18/07/2011 18:58:19                       ABEND  SQL CODE: 803
REQUEST  18/07/2011 19:00:46 F02 G974890 323144410                     
RESPONSE 18/07/2011 19:00:47                                           
REQUEST  18/07/2011 19:02:23 F02 G974650 112874160                     
RESPONSE 18/07/2011 19:02:23                       ABEND  SQL CODE: 803
REQUEST  18/07/2011 19:03:38 F02 G974601 032657752                     
RESPONSE 18/07/2011 19:03:38                                           
//SORTOUT  DD  SYSOUT=*                                                 
//SYSIN    DD  *                                                       
 INREC IFTHEN=(WHEN=GROUP,RECORDS=2,BEGIN=(1,7,CH,EQ,C'REQUEST'),       
                                     PUSH=(81:42,9))                   
 SORT FIELDS=COPY                                                       
 OUTFIL INCLUDE=(52,20,CH,EQ,C'ABEND  SQL CODE: 803'),BUILD=(81,9)     
/*                                                                     
//SYSOUT   DD  SYSOUT=*                                                 
 

OUTPUT
Code:
789334456
112874160

Thanks,
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Jul 20, 2011 7:04 am
Reply with quote

Hi,

this
Code:
INREC IFTHEN=(WHEN=GROUP,RECORDS=2,BEGIN=(1,7,CH,EQ,C'REQUEST'),       
                                     PUSH=(81:42,9))       

can be changed to
Code:
 INREC IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH=(81:42,9)) 



Gerry
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Wed Jul 20, 2011 7:39 am
Reply with quote

Gerry,
Yes I agree,in this case it works but I wanted to make sure about grouping them just in case...

Thanks,
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jul 20, 2011 10:01 am
Reply with quote

Hello,

What happens when the entries are interleaved rather than grouped together (as shown in the example data)?
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts To get the the current time DFSORT/ICETOOL 13
Search our Forums:

Back to Top