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

Adding header & trailer to output


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

New User


Joined: 16 Feb 2010
Posts: 46
Location: India

PostPosted: Tue Dec 17, 2013 11:00 pm
Reply with quote

Hi,

I have a requirement of adding header & trailer to my output file
Header should start from position 20 and should contain some text with the system date.

Trailer should contain a count of number of occurances of a specific text. Based on the resultant count write a message to the trailer.

I have gone through the various posts done by other members on related topics but could not get the desired result. I have tried the below code but it not giving the result I want.

Code:

//SORTIN   DD DISP=SHR,DSN=Input.sort
//SORTOUT  DD DSN=Output.REPORT,     
//SYSIN    DD  *                                     
 OPTION COPY                                         
 OUTFIL REMOVECC,                                     
 HEADER1=(20:'TEXT TEXT TEXT',DATE=(4MD/)),
 TRAILER1=(1,'END OF REPORT')                         
//*                                                   

I have not induced the count logic in the code yet. It would be really helpful if you can provide me some help in correcting the error and providing the logic to write the count with the text while writing the trailer.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Wed Dec 18, 2013 12:57 am
Reply with quote

Hi,

It would be great if you could post input, output and THE RULES
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 Dec 18, 2013 1:50 am
Reply with quote

Hello,

Quote:
Header should start from position 20 and should contain some text with the system date.

Trailer should contain a count of number of occurances of a specific text. Based on the resultant count write a message to the trailer.
As mentioned, you need to post some sample iniput and the output you want fro that sample input. You need to explain the rules for getting from the input to the output.

When asking for help, the biggest burden in on the requestor (you), You know what you want and what you have, we do not.

So, if you won't explain, we won't be much help.
Back to top
View user's profile Send private message
Skss

New User


Joined: 16 Feb 2010
Posts: 46
Location: India

PostPosted: Wed Dec 18, 2013 2:11 am
Reply with quote

Input file contains the job log which has the information whether the job has run sucessfully or not and I intend to get the information of the abended jobs and put it in a flat file in a report format.
Input format:

Code:

Job name
------JOBNAME--JOBID---ACT-STAT-SYID-------CPU-------I/O-STEP-----
    1 XXXXXXX   J061847                YYYY         
<--RC--PGM--------STEP-----PRSTEP---PROC-----COMMENTS
    0    PGMSTEP   $XXXXXX       
 ABND  SORT       
           
                       
 


In such a case the trailer should take an account of the job where the abend has occured write a text for the possible resolution.

Output format
Code:

                 Header                 Date
Job name
------JOBNAME--JOBID---ACT-STAT-SYID-------CPU-------I/O-STEP-----
    1 XXXXXXX   J061847                YYYY         
<--RC--PGM--------STEP-----PRSTEP---PROC-----COMMENTS
    0    PGMSTEP   $XXXXXX       
 ABND  SORT   

Trailer
Abend count : 1
Abended Job : XXXXXXX
Resolution : TEXT


Incase of no abend these fields should be filled by 0 & NONE

Please let me know if you need any more information.
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 Dec 18, 2013 3:25 am
Reply with quote

Hello,

Rather incomplete . . .

Do you plan on looking at only 1 job at a time? How would anyone know which joblog to look at?

As your system most likely uses some scheduling software, the info you want should be avaliable there.
Back to top
View user's profile Send private message
Skss

New User


Joined: 16 Feb 2010
Posts: 46
Location: India

PostPosted: Wed Dec 18, 2013 11:36 am
Reply with quote

As asked I have just provided sample data. The input file will contain similar data for almost 30 to 40 jobs.
Out of those jobs I will have to identify which job ran fine and which 1 did not and provide a count and descpreption of it.

Additionally the input file will also contain the job log which provides the detailed description starting from the start of the job till the end.
But the description which I will put in the trailer record does not have to come from the job log rather it will be a simple hardcoded text.
The idea of this report generation is basically notifying the status of the job run and not to provide a resolution if there is any abend.

As far as looking for this information from the scheduler is concerned, that will require a lot of manual effort to determine what is the status of each job.

I looking for some help to create the sort card which will help me do this.

Please let me know if you still see something not clear from a requirement prspective.

Awaiting your response!

Appreciate if you could provide me a sample sortcard which will serve the purpose.
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 Dec 18, 2013 12:32 pm
Reply with quote

Hello,

I'm rather certain I know what you want to do, but I do not believe you understand what this requires.

Where do you believe you can read all of this job info in one file?

As far as using the schedule information, this should Not be any amount of manual work. There are selection/reporting features in every schedule i''ve seen.

How will you determine the abend reason and provide text about a resolution.

Who provided this requirement?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Dec 18, 2013 12:51 pm
Reply with quote

and what is the reason to waste time, and IT resources to tell/repeat over and over what
should be documented and available in the application reference material for application errors/abend/return codes
and is already documented and available in each product reference material for SYSTEM errors/abend/return codes
Back to top
View user's profile Send private message
Skss

New User


Joined: 16 Feb 2010
Posts: 46
Location: India

PostPosted: Wed Dec 18, 2013 8:03 pm
Reply with quote

I have set up a batch job which will read the spool and will write it into a flat file for me. This flat file will act as an input for the sort card which I am trying to build with the help from you guys.
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 Dec 18, 2013 8:34 pm
Reply with quote

Hello,

How are you "reading the spool"? The "input" you show would be easier to work with if you put all of the actual data for a job on one line and did not put the "header" info in the file.

It is still not clear how you intend to get the abend info or how you intend to produce the resolution text.

If there are 10 abends and 2 are for different runs of the same job, how is this to be presented on your output? What kind of totals are wanted?

No one is going to be able to help with a "sort card" until it is explained how verything needs to work.
Back to top
View user's profile Send private message
Skss

New User


Joined: 16 Feb 2010
Posts: 46
Location: India

PostPosted: Wed Dec 18, 2013 9:23 pm
Reply with quote

Hi

1) As stated, I have set up a batch job to read my spool and it uses all generic IBM supplied utilites and nothing specific to my shop.

Do you want me to provide the batch job here too?
If yes then I am not sure how that is going to help

At this point I am not sure what else I can provide. If you want me to provide the actual data then it will not be possible because of the data privcy

2) As far as the resolution text is concerned, I have already stated that, it will be a generic notification message and will not provide any resolution
Quote:

Additionally the input file will also contain the job log which provides the detailed description starting from the start of the job till the end.
But the description which I will put in the trailer record does not have to come from the job log rather it will be a simple hardcoded text.
The idea of this report generation is basically notifying the status of the job run and not to provide a resolution if there is any abend.

If it is easier to do it without the 'resolution text' then lets do that.

3) I only check for 1 run of 1 job. Hence my job will only pull the status of the latest job and not the entire history of the runs.

Hope this provides you some lead!
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: Thu Dec 19, 2013 12:55 am
Reply with quote

Hello,

The more you explain what you are doing, less i understand it.

if the process will only handle one (1) job at a time, why have a counter? Why any new work (i.e. sort/header/trailer) at all?

Why not change the process that reads the spool to geneate the little bit of info you want for the one job . . . icon_confused.gif Why is this intermediate file even wanted/needed? For the little bit of new output you want, there is way too much busy work going on.

Suggest you use what you already have to read the spool and write out what you actually want . . .
Back to top
View user's profile Send private message
Skss

New User


Joined: 16 Feb 2010
Posts: 46
Location: India

PostPosted: Thu Dec 19, 2013 10:01 pm
Reply with quote

I will try to rephrase my requirement here

Hi,

My requirement is to build a sort card which will do the following this for me
1) Header starting from position 30 with system date starting from position 60
2) Trailer1 notifying the 'end of report'.
3) Trailer2 with a specific text count(text is 'ABND' which has a starting position of 2 in the input file and has a length of 4)
3) Trailer3 notifying the abended(ABND) jobs if any. If none found then report it with text 'NONE'

structure of input file :
Code:

Job name
------JOBNAME--JOBID---ACT-STAT-SYID-------CPU-------I/O-STEP-----
    1 XXXXXXX   J061847                YYYY         
<--RC--PGM--------STEP-----PRSTEP---PROC-----COMMENTS
    0    PGMSTEP   $XXXXXX       
 ABND  SORT       


Structure of output file
Code:

                Header                 Date
Job name
------JOBNAME--JOBID---ACT-STAT-SYID-------CPU-------I/O-STEP-----
    1 XXXXXXX   J061847                YYYY         
<--RC--PGM--------STEP-----PRSTEP---PROC-----COMMENTS
    0    PGMSTEP   $XXXXXX       
 ABND  SORT   

Trailer
Abend count : 1
Abended Job : XXXXXXX
 


Just to give you a breif info about the input file content:
The input contains the data read from IOF(interface to view job log in my shop)
30 to 40 jobs log will be written into the dataset. So need to check for abends if any.

Some more info
The RECL for both input & output file is 133
I need 3 lines of trailer records
If there are multiple abends then I need to list them all(i;e : Job1 Job2)
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 TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Adding QMF and SPUFI to the ISPF menu DB2 20
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts Adding first / last acct numerber to ... DFSORT/ICETOOL 7
Search our Forums:

Back to Top