generating jobs reports

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

REPLACE is a dynamic array function. You need CONVERT. Something like:

Code: Select all

EVAL "CONVERT('\', '_', CATEGORY) : '_index.html'"
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
loubi
Participant
Posts: 44
Joined: Fri Sep 08, 2006 6:41 am
Location: france

Post by loubi »

Ok Ok !! Thanks to all of you !

That's Ok ! My HTML documentation is now dynamically generated !

I used Ray code instead of my "replace" function and HTML generated has great links to all my HTML files !

Many many thanks for your help and your patiency. I've learned many things about DSX working on this project of documentation.

To help "others" with same problems, here it is a short description of my generation structure :

- A Job which select all categories and loop :

Code: Select all

Cmd = 'SELECT DS_JOBS SAVING UNIQUE CATEGORY TO 3'
      execute Cmd capturing output
      loop while readnext CatName from 3
And run KgdGenHtmlJobDocs with category in parameter.

- KgdGenHtmlJobDocs job which create HTML files for each job of selected category and an HTML index file for this category

- KgdGenHtmlFromSql job which generate index.html which contains links to each Category HTML file : query in parameter :

Code: Select all

SELECT DISTINCT EVAL "CONVERT('\', '_', CATEGORY) : '_index.html'" FROM DS_JOBS order by 1
I hope it will help.

Thanks again !

8)
loubi
Participant
Posts: 44
Joined: Fri Sep 08, 2006 6:41 am
Location: france

Post by loubi »

Hi all,

I would like to know where I can download some other stylesheet for reporting because the default one is very ugly !!!

Thanks a lot.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

You have the code. You does not use a style sheet. It generates simple html. Send me an example of what you want and maybe I will change it otherwise you have the code. You can change it yourself.

The JobReport routine was not written by me. IBM would need to give you that code.
Mamu Kim
loubi
Participant
Posts: 44
Joined: Fri Sep 08, 2006 6:41 am
Location: france

Post by loubi »

Hi kim,

thanks for your reply !

in fact, I'm in a new company and they want to add some explanation in their jobs. So, I fill "full description" field with informations about sources, targets and description of treatment.

But, These informations aren't well formatted when I use jobreport function in datastage, so I don't use your code for the moment, that's why I ask for more stylesheet (used in DS reporting function).

In my opinion, I will soon deploy the same documentation process that I deploy in my older company so I will probably have the same problem in next weeks.

It will be fun if you could tell me how to insert formatting tags in full description field in job control, to have a well formatted text in generated HTML file !

I hope you understand my problem !

thanks a lot !
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

I usually put the full description in a annotation box on the design. Then it shows up on your documentation.
Mamu Kim
loubi
Participant
Posts: 44
Joined: Fri Sep 08, 2006 6:41 am
Location: france

Post by loubi »

Ok kim Thanks for reply about description of job in annotation

I imported KGDgenHTML and co from your website, and I tried to launch it to show results to my boss.

Unfortunately, It doesn't work for the moment. And I haven't any fatal error in log.

At First, I imported jobs and routines but I didn't have KGDMakeDir routine. So I imported it (in fact, I download your routines.zip, and I copy/paste KgdMakeDir.txt content to a new routine I create).

I tried to launch again the job to generate the doc and It fails because, even if I imported KgdMakeDir, Job couldn't create directories on server.

I created KimD/Jobs/20070320 directories manually and I launch again.

And Job is still in abort without fatal error in log. I see in log that job found successfully all jobs I want to report with the request but after that I have this :

Code: Select all

KgdGenHtmlJobDocs..JobControl (KgdGenHtmlJobDocs): JobReport(AUTOSQ01MODULEDITIQUEFirstStart,OutputDirectory,LogoPath,Style,Language)
And after that the warning about attempting to clean after abort.

But no fatal error.

Oh, I forgot to precise that I have a UNIX server but by watching job control, It not seems to be a problem ?

Have you an idea ?

Thanks a lot for reading me and maybe answering me ;);)
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

If you do not have write permission to these directories then you will have problems. It fails hard without any error messages. I should have else clauses on my writes but maybe I missed some. The JobReport routine should be there as well. I did not write this so I cannot fix it.

There are notes on installing EtlStats and a video somewhere. It has these jobs as a subset. It might help to watch the video.

vtt/ETLStats.php
Mamu Kim
loubi
Participant
Posts: 44
Joined: Fri Sep 08, 2006 6:41 am
Location: france

Post by loubi »

Hi,
Firstable, Thanks Kim to be here to answer me about this ..... generation !!

I am working in new environment. I want to run the KgdGenHtmlJobDocs jobs but i get an error

"Attempting to Cleanup after ABORT raised in stage KgdGenHtmlJobDocs..JobControl"

so i put some comments on the code to find where it comes from:

Code: Select all

Call DSLogInfo("Avant JobReport", ThisJobName)
Call DSLogInfo("JobReport(":JobName:",":OutputDirectory:",":LogoPath:",":Style:",":Language:")", ThisJobName)     Junk = JobReport(JobName, OutputDirectory, LogoPath, Style, Language)
Call DSLogInfo("Apres JobReport", ThisJobName)
when i look the director i do not get the message "Apres JobReport", So it seems that's the routine does not work :
JobReport(Bcpf,/home/dsisid/html/KimD/Jobs/20070713,/home/dsisid/html/image.jpg,1,English)

After your reply kim, i checked my writes and the full directory "/home/dsisid/html/KimD/Jobs/20070713" is in 777

Thanks
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

I have not looked at this code in a couple years. Make sure OutputDirectory exists. Make sure JobReport exists in your routines. LogoPath is a jpg for your comapny logo. Does it exist.
Mamu Kim
Tlam
Participant
Posts: 16
Joined: Thu Aug 23, 2007 12:56 am

Post by Tlam »

Hi,

I worked with datastage since begin of this month. My manager asked me document all the datastage jobs in our Production environement, then I found this topic. I have imported this KgdGenHtml from Kim Duke.

When I run this, it got aborted.

See below details:

KgdGenHtmlJobDocs: Set NLS locale to US-ENGLISH,US-ENGLISH,US-ENGLISH,US-ENGLISH,US-ENGLISH

KgdGenHtmlJobDocs..JobControl (KgdGenHtmlJobDocs): KgdMakeDir(/home/staff/tlam/KimD/Jobs/20070829)

Attempting to Cleanup after ABORT raised in stage KgdGenHtmlJobDocs..JobControl

Job KgdGenHtmlJobDocs aborted.

Please advice where I can look into it to solve this issue.

Thanks

Tlam
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Does this directory exist /home/staff/tlam/KimD/Jobs? It is trying to create /20070829 below this. The user running the job needs to be able to this directory.
Mamu Kim
Tlam
Participant
Posts: 16
Joined: Thu Aug 23, 2007 12:56 am

Post by Tlam »

kduke wrote:Does this directory exist /home/staff/tlam/KimD/Jobs? It is trying to create /20070829 below this. The user running the job needs to be able to this directory.
Hi Kim,

Thanks for replying, for your information, I have filled in following information.

Filepath: /home/staff/tlam/
Logopath: /home/staff/tlam/ourlogo.jpg
category or all: Data Integration\IFS-PS\AP

So it seems it want to create directory /KimD/jobs/20070829

Further information, I run datastage via a citrix server, on that server I have access to create directory read and write etc.

Please advice.

Thanks
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

kduke wrote:If you do not have write permission to these directories then you will have problems. It fails hard without any error messages. I should have else clauses on my writes but maybe I missed some. The JobReport routine should be there as well. I did not write this so I cannot fix it.

There are notes on installing EtlStats and a video somewhere. It has these jobs as a subset. It might help to watch the video.

vtt/ETLStats.php
If this link does not work the try:

http://www.duke-consulting.com/EtlStats1.html

Not exactly the same video but the same info. Walter dressed up the first version.
Mamu Kim
kommven
Charter Member
Charter Member
Posts: 125
Joined: Mon Jul 12, 2004 12:37 pm

Attempting to Cleanup after ABORT raised in stage KgdGenHtml

Post by kommven »

I see the same error message on the Director :
KgdGenHtmlJobDocs..JobControl (KgdGenHtmlJobDocs): JobReport(ADRP_LOOKUP_TABLE_SEQ,OutputDirectory,LogoPath,Style,Language)

Attempting to Cleanup after ABORT raised in stage KgdGenHtmlJobDocs..JobControl

After reading all posts I have checked:
1. Permissions on the Unix Directory
2. The parameters are set correct.

I tried testing Routine JobReport but it fails with this error.
TEST #1
*******

Arg1 = AXIS*
Arg2 = /etl/dsprojects/TPS_DEV/KimD/Jobs/20080109
Arg3 =
Arg4 =
Arg5 =

Test failed.

Subroutine "DSU.JobReport" called with 6 arguments, 0 were expected"
Program "TSTJobReport.B": Line 3, Unable to load subroutine.


Any help on this?
Post Reply