JESMSGLG data needs to reformat and extracts to outfile



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

JESMSGLG data needs to reformat and extracts to outfile

Postby koteswararaonaidu » Fri Feb 25, 2011 1:43 am

I can extract the JESGMSGLG of particular job using below code,

DATAOUT DD DSN=SYSID.DATASET.JES, DISP=MOD
//ISFIN DD *
ST
PRE LOGNAME0
FILTER JOBNAME EQ LOGNAME0
FIND 'LOGNAME0'
++?
FIND 'JESMSGLG'
++S
PRINT FILE DATAOUT
PRINT 1 999
PRINT CLOSE
END

So now am have JESMSGLG data of the LOGNAME0 into this file "SYSID.DATASET.JES",

The file attributes are mentioned here below,


Current Allocation
Allocated tracks . : 776
Allocated extents . : 156

Organization . . . : PS Current Utilization
Record format . . . : FBA Used tracks . . . . : 696
Record length . . . : 5004 Used extents . . . : 141
Block size . . . . : 5004
1st extent tracks . : 1
Secondary tracks . : 5


The log data resides in the dataset like ERROR(E),WARNING(W),INFORMATION(I) with timestamps...

INPUT FILE DATA:
---- THURSDAY, 24 FEB 2011 ----

02.14.32 S0038798 +DFHAM4835 E LOGNAME0 849
849 Install of TDQUEUE PZST failed because the queue has already been
849 defined to the system, and initialization is still in progre

(Here in above, msg is spanning in multiple lines with continution number as 3 digit(which needs to remove in my o/p file) )

15.02.51 S0038798 +PGMNAME1.0006E LOGNAME0 AZIG Abend encoutered in PROGRAM1.


I need eeror messages with time stamps and current date alone only in my output file ,No need of warning and information messages ,
And omit all the previous days JESMSGLG data,

OUTPUT FILE data should be like below in single line foramt,

02.14.32 DFHAM4835 E LOGNAME0 849 Install of TDQUEUE PZST failed because the queue has already been defined to the system, and initialization is still in progress.CURRENT DATE.


15.02.51 PGMNAME1.0006E LOGNAME0 AZIG Abend encoutered in PROGRAM1.CURRENT DATE

COuld you please help me?
koteswararaonaidu
 
Posts: 4
Joined: Thu Jan 20, 2011 8:18 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JESMSGLG data needs to reformat and extracts to outfile

 

Re: JESMSGLG data needs to reformat and extracts to outfile

Postby Frank Yaeger » Fri Feb 25, 2011 2:31 am

You'd have to do a better job of describing the rules for what you want to extract and not extract with a more comprehensive example before I could help you. I'd need to know all of the variations you need to deal with. What exactly starts a group you want to extract? What exactly ends a group you want to extract? We need clear/comprehensive rules in order to write the correct control statements.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: JESMSGLG data needs to reformat and extracts to outfile

Postby koteswararaonaidu » Fri Feb 25, 2011 8:57 pm

Hi Frank,

Thank you very much for your quick reply....Please go through the below details and spoonfeed me.

We have the output records from a JES2 started task (i.e. a DB2 subsystem). It contains the messages that the subsystem wanted to write to the JES job log. Such messages can be one line messages, or they can be split into multiple records, by this adding a sequence number as the last word in a record, and the same sequence number as the first word in the continued record. This is how it looks like:

---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8------134
********************************* TOP OF DATA **********************************
J E S 2 J O B L O G -- S Y S T E M LPAR -- N O D E

00.00.01 S0042996 ---- TUESDAY, 22 FEB 2011 ----

14.34.04 S0042996 +PZMABCDE.0006E LOGNAMEK AZIG Abend encoutered in PROGRAMID. -------------------->1

04.34.23 S0042996 +DFHAM4835 E LOGNAMEK 959 ---------------------------------------------------------->2
959 Install of TDQUEUE PZST failed because the queue has already
959 defined to the system, and initialization is still in progre

08.51.35 S0085716 +PZMFGHIJ.0001E LOGNAMEK No free threads --------------------------------------------------------->3
08.51.35 S0085716 +PZMKLMNO.0072E LOGNAMEK Thread manager Create Thread failed --------------------------->4

18.54.17 S0038798 +PZMPQRST.0002E LOGNAMEK 477 --------------------------------------------------------------------->5
477 CCABCDEFGH,JKLMNO_BO_D12,CommMgmt KLMNO_Consumr PZMPQRST err--------------------------->6
477 from z/OS XML Services: Return code:000000012 Reason code:x3--------------------------------------------------->7
477 Diagnostic:ERROR BYTE NUMBER 000000032 *</UserId>


14.34.04 S0042996 +PZMABCDE.0006I LOGNAMEK Backout exit PROGRAMID invoked succe .



What I do need is the following:

1.Search that message file for a specific string, e.g. the string 'REASON'. (in the sample above 5 type Errormsgs, you'll find it on lines 7 ), +PZM*****.****E LOGNAMEK ---(E(Error) starts 34 pos, LOGNAMEK starts 36 to 43,PZM starts 21 to 23).

2.Search that message file for a specific string, e.g. the string 'Abend encoutered in' starts from 50 pos to 68 pos. (in the sample above 1 type Error msgs ), +PZM*****.****E LOGNAMEK---(E(Error) starts 34 pos, LOGNAMEK starts 36 to 43,PZM starts 21 to 23).

3.Search that message file for a specific string, e.g. the string (in the sample above 2 type Error msgs )+DFH****** E LOGNAMEK ---(E(Error) starts 31 pos, LOGNAMEK starts 33 to 40,DFH starts 21 to 23).

4.Search that message file for a specific string, e.g. the string (in the sample above 3,4 type Error msgs )+PZM*****.****E LOGNAMEK ---(E(Error) starts 34 pos, LOGNAMEK starts 36 to 43, PZM starts 21 to 23)

5.If that strings has been found, extract the entire message.

6.If the message has continuation indicators (these three digit numbers 447(varying number for each error msgs), remove the numbers from the end of the first message and all continuation records and combine all these parts to one message line. We could assume this continuation indicator line numbers upto 6 lines for our requirement.

7.Remove all but one space between all words of a resulting message line

8. The dataset can contain messages for more than one weekday ,So need Current Week days data by excluding previous days data. These dates should be included in the output.And Error message denotes with (E) , and respectively Information(I),Warning(W) in above JESLOG.Needs extract Error information only.

A sample of the generated output for the above lines should look like below :

14.34.04 PZMABCDE.0006E LOGNAMEK AZIG Abend encoutered in PROGRAMID.CURRENT DATE

04.34.23 PZMPQRST.0002E LOGNAMEK Install of TDQUEUE PZST failed because the queue has already defined to the system, and initialization is still in progre.CURRENT DATE.

08.51.35 PZMFGHIJ.0001E LOGNAMEK No free threads .CURRENT DATE

08.51.35 PZMKLMNO.0072E LOGNAMEK Thread manager Create Thread failed.CURRENT DATE.

18.54.17. PZMPQRST.0002E LOGNAMEK CCABCDEFGH,JKLMNO_BO_D12,CommMgmt KLMNO_Consumr PZMPQRST err from z/OS XML Services: Return code:000000012 Reason code:x3 Diagnostic:ERROR BYTE NUMBER 000000032 *</UserId>




Known specifications:

1. Date messages can be identified by four dashes in record position 20, the date without leading weekday starts at pos 36.

2. A message starts with a time (hours) in pos 2-3 and may or may not have a continuation indication (digits)

3. A continued message shows two spaces in record pos 2-3, and then 3 digits

4.Input dataset is RECFM=FBA, LRECL=134, the max output record length should be (truncated to) 32760.



Please let me know if you need more details....Many Thanks in advance!!!!!!!!!!!!!!!!
koteswararaonaidu
 
Posts: 4
Joined: Thu Jan 20, 2011 8:18 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JESMSGLG data needs to reformat and extracts to outfile

Postby Frank Yaeger » Sat Feb 26, 2011 2:21 am

Sorry, but I don't have time to do this for you. I have my own job to do. I don't mind showing people how to use DFSORT for well-defined, reasonably simple requirements, but this is well beyond what I'm willing to do (just getting you to give me a usable explanation of the requirement would take more time than I have to spend). Maybe somebody else who participates on this board has the time to "spoon feed" you on this. :(
Or perhaps you could just write a program in your preferred language.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: JESMSGLG data needs to reformat and extracts to outfile

Postby dick scherrer » Sat Feb 26, 2011 3:08 am

Hello,

The good news is that it is now weekend and if this is wanted soon, there is an entire weekend to get a jump-start on the programming . . .

People here won't write the code for you, but several of us will help if you get stuck. Many of us check in during the weekend.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: JESMSGLG data needs to reformat and extracts to outfile

Postby koteswararaonaidu » Sat Feb 26, 2011 6:58 am

Hi Frank/Dick,

Thanks again for your quick reply !!!!!!!!!

As am a beginner in sort and programming....and new to forums...I expected the spoonfeed from you people .Sorry for this.

Is it possible to achive my requirement with SORT, If it can ,then please suggest me with some Hints and a small peace of codes.
koteswararaonaidu
 
Posts: 4
Joined: Thu Jan 20, 2011 8:18 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JESMSGLG data needs to reformat and extracts to outfile

Postby dick scherrer » Sat Feb 26, 2011 9:41 am

Hello,

I believe it is not a question of whether it can be done with sort. . . Almost everything can be done with a given tool if one has sufficient knowledge of that tool and a lot of time to invest. As Frank mentioned, he does not have the time. . .

As this is something you want/need, you need to create it using tools that you know best (probably some programming language).

As am a beginner in sort and programming....and new to forums...I expected the spoonfeed from you people .Sorry for this.
Not to worry. . . :)

You should understand though that good forums are to help you learn, not do the work for you. And A caution - Sometimes forums that "do the work" often post "solutions" that do not work correctly. Which causes a new person even more grief/problems.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: JESMSGLG data needs to reformat and extracts to outfile

Postby koteswararaonaidu » Sat Feb 26, 2011 11:02 am

Thank you Dick, :) i understood...

I would like to work with sort to achive this requiremet.Please gimme some Hints ..
koteswararaonaidu
 
Posts: 4
Joined: Thu Jan 20, 2011 8:18 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JESMSGLG data needs to reformat and extracts to outfile

Postby dick scherrer » Sat Feb 26, 2011 11:40 am

Hello,

Most people who are long-time sort users would find this difficult at best. Using the sort is not the best answer for "everything".

Someone new to "sort code" should not even attempt it (imho).

If you want this implemented, i suggest you begin designing the code in some language that you do have some training/exierience using.

It will probably be more than a "quickie" no matter how you approach it.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: JESMSGLG data needs to reformat and extracts to outfile

Postby Frank Yaeger » Mon Feb 28, 2011 11:53 pm

Is it possible to achive my requirement with SORT


Maybe.

If it can ,then please suggest me with some Hints and a small peace of codes.


I can't because you haven't explained your requirement clearly enough. The first stage of any programming project is defining the requirements. That takes a certain amount of skill. Your explanation of the requirements is not clear to me and I don't have time to "spoon-feed" you to help you define it more clearly.

The only hint I can give you is that DFSORT's GROUP function would probably be involved.

Since you have to walk before you run, if you want to learn how to use DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss? ... g3T7000080
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post