Using sdk routine in job control

Archive of postings to DataStageUsers@Oliver.com. This forum intended only as a reference and cannot be posted to.

Moderators: chulett, rschirm

Locked
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Using sdk routine in job control

Post by admin »

-----Original Message-----
From: Tracy Slack [mailto:Tracy.Slack@harlandfs.com]
Sent: Friday, October 17, 2003 4:52 PM
To: 'datastage-users@oliver.com'
Subject: Using sdk routine in job control



Hello,

We are writing in Job Control BASIC to read some EBCDIC data (via READBLK).
I need to unpack a particular 2-byte section of this data, and I really want
to just call the sdk routine DataTypePicS9. Is this possible to get at all
these neat functions, perhaps just be adding another "include" statement at
the top of my Job Control? I'd rather not have to clone the source code of
this routine into my Job Control.

Part of the Job Control source is included below. See the "OUR TROUBLE SPOT"
at the bottom section. This is where we are trying to unpack and convert a
couple of bytes in this EBCDIC data file, and then inspect them. We actually
have 2 places in our routine where we need this, but you get the idea.

The bytes in question are formatted PIC S9(4) COMP-3, and we can inspect our
small sample data in a hex editor utility and see what we want to get for an
answer, but are unable to get it to work with OCONV, etc. So, how can I use
functions like DataTypePicS9 to work with this data?

We're prototyping this utility under DStage v4.1, but intend to be porting
to DStage v6.0.1 and using the CFF stage on the output of this Job Control.

The reason for this Job Control in the first place is that our stream EBCDIC
data is variable length, no line terminators, and has "varies depending on"
record lengths. Ascential Tech Support and others have confirmed that the
CFF stage cannot do "varies depending on" to figure out a record length.

So, we need to add our own line terminators before sending the data into the
CFF stage.

Thanks for any advice you can provide.

Regards,

Tracy Slack

Harland Financial Solutions
tracy.slack@harlandfs.com
503-274-7280 or 800-274-7280 x2047
-------------------------------------------------------

****************************************************************************
***************************

$INCLUDE UNIVERSE.INCLUDE ODBC.H
* Get current job name
JobName = DSGetJobInfo(DSJ.ME,DSJ.JOBNAME)
* Sample Call DSLogInfo("ScalarValue just fetched is: ":runno:" with Status:
":STATUS, JobName)
OPEN "FDRPARAMhash" TO param THEN NULL
OPENSEQ "d:\ezud\extract\fdr_Cif_sample_data" TO S.CFF ELSE NULL
OPEN "D:\ezud\extract" TO F1 THEN
DELETE F1,'fdr_Cif.cff"
END ELSE
Call DSLogInfo("Unable to OPEN",JobName)
END
OPENSEQ "d:\ezud\extract\fdr_Cif.cff" TO S.OUTPUT ELSE NULL
CRLF=CHAR(13):CHAR(10)
HASHRECS = ''
EOR = 1
LOOP
max_rec = 0
fix_length = 0
var_length = 0
nbr_rep = 0

READBLK FIXEDrec FROM S.CFF,189 ELSE EXIT
* Search bytes 186 - 187 for record type

**********************************************************************
*********** OUR TROUBLE SPOT, DataTypePicS9() does not work here.
*********** compile error msg "DataTypePicS9 never dimensioned.
*****************************************

rec_tp = seq(DataTypePicS9(FIXEDrec[186,2]))

**** (there is more code following but not relevent to this problem)
****************************************************************************
***************************
<b>PLEASE READ</b>
Do not contact admin unless you have technical support or account questions. Do not send email or Private Messages about discussion topics to ADMIN. Contact the webmaster concerning abusive or offensive posts.
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Using sdk routine in job control

Post by admin »

-----Original Message-----
From: Ray Wurlod [mailto:rayw@mindless.com]
Sent: Friday, October 17, 2003 8:56 PM
To: datastage-users@oliver.com
Subject: Re: Using sdk routine in job control


The SDK routines are not directly accessible, as they are recorded in the
DataStage Catalog as user-written routines, and thus have names beginning
with "DSU." as far as DataStage job control code is concerned. You have
either of two solutions available:
(1) invoke the function DSU.DataTypePicS9 directly
(2) declare that DataTypePicS9 invokes DSU.DataTypePicS9 with a DEFFUN
declaration:
DEFFUN DataTypePicS9(Arg1) Calling "DSU.DataTypePicS9"

----- Original Message -----
From: Tracy Slack
Date: Fri, 17 Oct 2003 14:51:35 -0700
To: "'datastage-users@oliver.com'"
Subject: Using sdk routine in job control

>
> Hello,
>
> We are writing in Job Control BASIC to read some EBCDIC data (via
READBLK).
> I need to unpack a particular 2-byte section of this data, and I really
want
> to just call the sdk routine DataTypePicS9. Is this possible to get at all
> these neat functions, perhaps just be adding another "include" statement
at
> the top of my Job Control? I'd rather not have to clone the source code of
> this routine into my Job Control.
>
> Part of the Job Control source is included below. See the "OUR TROUBLE
SPOT"
> at the bottom section. This is where we are trying to unpack and convert a
> couple of bytes in this EBCDIC data file, and then inspect them. We
actually
> have 2 places in our routine where we need this, but you get the idea.
>
> The bytes in question are formatted PIC S9(4) COMP-3, and we can inspect
our
> small sample data in a hex editor utility and see what we want to get for
an
> answer, but are unable to get it to work with OCONV, etc. So, how can I
use
> functions like DataTypePicS9 to work with this data?
>
> We're prototyping this utility under DStage v4.1, but intend to be porting
> to DStage v6.0.1 and using the CFF stage on the output of this Job
Control.
>
> The reason for this Job Control in the first place is that our stream
EBCDIC
> data is variable length, no line terminators, and has "varies depending
on"
> record lengths. Ascential Tech Support and others have confirmed that the
> CFF stage cannot do "varies depending on" to figure out a record length.
>
> So, we need to add our own line terminators before sending the data into
the
> CFF stage.
>
> Thanks for any advice you can provide.
>
> Regards,
>
> Tracy Slack
>
> Harland Financial Solutions
> tracy.slack@harlandfs.com
> 503-274-7280 or 800-274-7280 x2047
> -------------------------------------------------------
>
>
****************************************************************************
> ***************************
>
> $INCLUDE UNIVERSE.INCLUDE ODBC.H
> * Get current job name
> JobName = DSGetJobInfo(DSJ.ME,DSJ.JOBNAME)
> * Sample Call DSLogInfo("ScalarValue just fetched is: ":runno:" with
Status:
> ":STATUS, JobName)
> OPEN "FDRPARAMhash" TO param THEN NULL
> OPENSEQ "d:\ezud\extract\fdr_Cif_sample_data" TO S.CFF ELSE NULL
> OPEN "D:\ezud\extract" TO F1 THEN
> DELETE F1,'fdr_Cif.cff"
> END ELSE
> Call DSLogInfo("Unable to OPEN",JobName)
> END
> OPENSEQ "d:\ezud\extract\fdr_Cif.cff" TO S.OUTPUT ELSE NULL
> CRLF=CHAR(13):CHAR(10)
> HASHRECS = ''
> EOR = 1
> LOOP
> max_rec = 0
> fix_length = 0
> var_length = 0
> nbr_rep = 0
>
> READBLK FIXEDrec FROM S.CFF,189 ELSE EXIT
> * Search bytes 186 - 187 for record type
>
> **********************************************************************
> *********** OUR TROUBLE SPOT, DataTypePicS9() does not work here.
> *********** compile error msg "DataTypePicS9 never dimensioned.
> *****************************************
>
> rec_tp = seq(DataTypePicS9(FIXEDrec[186,2]))
>
> **** (there is more code following but not relevent to this problem)
>
****************************************************************************
> ***************************
>
>
<b>PLEASE READ</b>
Do not contact admin unless you have technical support or account questions. Do not send email or Private Messages about discussion topics to ADMIN. Contact the webmaster concerning abusive or offensive posts.
Locked