Reading COBOL File to Sequence file - COMP-3 conversion.

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

Reading COBOL File to Sequence file - COMP-3 conversion.

Post by admin »

Hi ALL,

Gurus, I am getting a COBOL file from Mainframe and the structure look
like this.

----------------------------- COBOL file structure ----------------------
01 MFBTW-BTWCOL.
02 COL-REC.
03 COL-REC-KEY.
04 COL-BRH-REF PIC X(7).
04 COL-TRAN-GRP PIC X(5).
04 COL-CPTY-TWO PIC X(7).
04 COL-TRAN-ID PIC X(6).
03 COL-RTE PIC S9(3)V9(8)
COMP-3.
03 COL-AMT-2 PIC S9(15)
COMP-3.
03 COL-COM-ACR-DTE PIC 9(8).
03 COL-OTR-REF PIC X(20).
03 COL-VER-BNR PIC 9(4)
COMP.
03 COL-TRAN-SEQ PIC X(9).
------------------------------------------------------------------------------

When I import the above structure It considered the COMP-3 as decimal.
Then as per examples I specified the NLS to None for CFF Stage
and in the transformation I mentioned for the COL-AMT-2 like this
"DataTypePicComp3( DSLink17.COL_AMT_2)"

In the output for that column I getting the value like this
"323032303230323" The actual should be 2639.63.

Can anyone help me how to get value for the COMP-3 & COMP types.



Thanks with Regards,
Thiruma Valavan.
Visit us on www.alfransi.com.sa
====== Banque Saudi Fransi - Privacy Notice ======
This message is intended only for the person or entity to which it is
addressed and may contain confidential and/or privileged material. Any
use of this information by persons or entities other than the intended
recipient is prohibited. If you have received this in error, please
contact the sender and delete the material from your computer. Any
opinions and other information contained in this message that do not
relate to the official business of Banque Saudi Fransi shall be
understood as neither given or endorsed by it.
====== Banque Saudi Fransi - Privacy Notice ======
<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

Reading COBOL File to Sequence file - COMP-3 conversion.

Post by admin »

Something to check...

If you moved your file from the mainframe to another platform like
UNIX, did you indicate to the FTP software that the source file was
EBCDIC ? Mainframes operate with an EBCDIC character set. Unix
operates with an ASCII character set. Failure to convert to ASCII will
result in garbage / corrupt data in your file. This could be one
possible cause...

Len O'Toole

-----Original Message-----
From: TValavan@AlFransi.com.sa [mailto:TValavan@AlFransi.com.sa]
Sent: Wednesday, January 14, 2004 9:45 AM
To: datastage-users@oliver.com
Subject: Reading COBOL File to Sequence file - COMP-3 conversion.





Hi ALL,

Gurus, I am getting a COBOL file from Mainframe and the structure
look
like this.

----------------------------- COBOL file structure
----------------------
01 MFBTW-BTWCOL.
02 COL-REC.
03 COL-REC-KEY.
04 COL-BRH-REF PIC X(7).
04 COL-TRAN-GRP PIC X(5).
04 COL-CPTY-TWO PIC X(7).
04 COL-TRAN-ID PIC X(6).
03 COL-RTE PIC S9(3)V9(8)
COMP-3.
03 COL-AMT-2 PIC S9(15)
COMP-3.
03 COL-COM-ACR-DTE PIC 9(8).
03 COL-OTR-REF PIC X(20).
03 COL-VER-BNR PIC 9(4)
COMP.
03 COL-TRAN-SEQ PIC X(9).
----------------------------------------------------------------------
--------

When I import the above structure It considered the COMP-3 as decimal.
Then as per examples I specified the NLS to None for CFF Stage and in
the transformation I mentioned for the COL-AMT-2 like this
"DataTypePicComp3( DSLink17.COL_AMT_2)"

In the output for that column I getting the value like this
"323032303230323" The actual should be 2639.63.

Can anyone help me how to get value for the COMP-3 & COMP types.



Thanks with Regards,
Thiruma Valavan.
Visit us on www.alfransi.com.sa
====== Banque Saudi Fransi - Privacy Notice ====== This message is
intended only for the person or entity to which it is addressed and
may contain confidential and/or privileged material. Any use of this
information by persons or entities other than the intended recipient
is prohibited. If you have received this in error, please contact
the sender and delete the material from your computer. Any opinions
and other information contained in this message that do not relate to
the official business of Banque Saudi Fransi shall be understood
as neither given or endorsed by it.
====== Banque Saudi Fransi - Privacy Notice ======
<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

Reading COBOL File to Sequence file - COMP-3 conversion.

Post by admin »

We have ran into the same issue. We had folks that were FTPing the
files as ASCII from our AS/400 and I spent a lot of time in the Hex
Editor before I figured out what they had done. Text mode FTP works
fine as long as all of the fields are formatted as character types but
it causes problems with the binary encoded data (such as the COMP-3)
data. You will need to FTP the file in binary mode and use both the
EBCDIC-ASCII conversion as well as the COMP-3 conversion functions to
read the data.

-----Original Message-----
From: Len O'Toole [mailto:lenotoole2@cox-internet.com]
Sent: Wednesday, January 14, 2004 8:46 AM
To: datastage-users@oliver.com
Subject: RE: Reading COBOL File to Sequence file - COMP-3 conversion.


Something to check...

If you moved your file from the mainframe to another platform like
UNIX, did you indicate to the FTP software that the source file was
EBCDIC ? Mainframes operate with an EBCDIC character set. Unix
operates with an ASCII character set. Failure to convert to ASCII will
result in garbage / corrupt data in your file. This could be one
possible cause...

Len O'Toole

-----Original Message-----
From: TValavan@AlFransi.com.sa [mailto:TValavan@AlFransi.com.sa]
Sent: Wednesday, January 14, 2004 9:45 AM
To: datastage-users@oliver.com
Subject: Reading COBOL File to Sequence file - COMP-3 conversion.





Hi ALL,

Gurus, I am getting a COBOL file from Mainframe and the structure
look
like this.

----------------------------- COBOL file structure
----------------------
01 MFBTW-BTWCOL.
02 COL-REC.
03 COL-REC-KEY.
04 COL-BRH-REF PIC X(7).
04 COL-TRAN-GRP PIC X(5).
04 COL-CPTY-TWO PIC X(7).
04 COL-TRAN-ID PIC X(6).
03 COL-RTE PIC S9(3)V9(8)
COMP-3.
03 COL-AMT-2 PIC S9(15)
COMP-3.
03 COL-COM-ACR-DTE PIC 9(8).
03 COL-OTR-REF PIC X(20).
03 COL-VER-BNR PIC 9(4)
COMP.
03 COL-TRAN-SEQ PIC X(9).
----------------------------------------------------------------------
--------

When I import the above structure It considered the COMP-3 as decimal.
Then as per examples I specified the NLS to None for CFF Stage and in
the transformation I mentioned for the COL-AMT-2 like this
"DataTypePicComp3( DSLink17.COL_AMT_2)"

In the output for that column I getting the value like this
"323032303230323" The actual should be 2639.63.

Can anyone help me how to get value for the COMP-3 & COMP types.



Thanks with Regards,
Thiruma Valavan.
Visit us on www.alfransi.com.sa
====== Banque Saudi Fransi - Privacy Notice ====== This message is
intended only for the person or entity to which it is addressed and
may contain confidential and/or privileged material. Any use of this
information by persons or entities other than the intended recipient
is prohibited. If you have received this in error, please contact
the sender and delete the material from your computer. Any opinions
and other information contained in this message that do not relate to
the official business of Banque Saudi Fransi shall be understood
as neither given or endorsed by it.
====== Banque Saudi Fransi - Privacy Notice ======
<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

Reading COBOL File to Sequence file - COMP-3 conversion.

Post by admin »

Exactly. Packed Decimal fields like COMP-3 are identical in ASCII or EBCDIC
files. Converting them either way turns them into garbage. So you'll need
to do the EBCDIC conversions inside DataStage for the character strings and
handle the COMP-3 conversions separately. I haven't used the CFF stage, but
in general when doing this kind of conversion you define the input side as a
character field, size including sign / 2 (rounded up). For example,

Size of S9(3)V9(8) COMP-3 = CHAR(6) (11+1 / 2)
Size of S(15) COMP-3 = CHAR(8) (15+1 / 2)

Define them as character fields, apply the COMP-3 conversion functions and
then output them to the proper numeric format.

-craig

-----Original Message-----
From: Shawn Ramsey [mailto:SRamsey@starbucks.com]
Sent: Wednesday, January 14, 2004 10:08 AM
To: datastage-users@oliver.com
Subject: RE: Reading COBOL File to Sequence file - COMP-3 conversion.


We have ran into the same issue. We had folks that were FTPing the
files as ASCII from our AS/400 and I spent a lot of time in the Hex
Editor before I figured out what they had done. Text mode FTP works
fine as long as all of the fields are formatted as character types but
it causes problems with the binary encoded data (such as the COMP-3)
data. You will need to FTP the file in binary mode and use both the
EBCDIC-ASCII conversion as well as the COMP-3 conversion functions to
read the data.

-----Original Message-----
From: Len O'Toole [mailto:lenotoole2@cox-internet.com]
Sent: Wednesday, January 14, 2004 8:46 AM
To: datastage-users@oliver.com
Subject: RE: Reading COBOL File to Sequence file - COMP-3 conversion.


Something to check...

If you moved your file from the mainframe to another platform like
UNIX, did you indicate to the FTP software that the source file was
EBCDIC ? Mainframes operate with an EBCDIC character set. Unix
operates with an ASCII character set. Failure to convert to ASCII will
result in garbage / corrupt data in your file. This could be one
possible cause...

Len O'Toole

-----Original Message-----
From: TValavan@AlFransi.com.sa [mailto:TValavan@AlFransi.com.sa]
Sent: Wednesday, January 14, 2004 9:45 AM
To: datastage-users@oliver.com
Subject: Reading COBOL File to Sequence file - COMP-3 conversion.





Hi ALL,

Gurus, I am getting a COBOL file from Mainframe and the structure
look
like this.

----------------------------- COBOL file structure
----------------------
01 MFBTW-BTWCOL.
02 COL-REC.
03 COL-REC-KEY.
04 COL-BRH-REF PIC X(7).
04 COL-TRAN-GRP PIC X(5).
04 COL-CPTY-TWO PIC X(7).
04 COL-TRAN-ID PIC X(6).
03 COL-RTE PIC S9(3)V9(8)
COMP-3.
03 COL-AMT-2 PIC S9(15)
COMP-3.
03 COL-COM-ACR-DTE PIC 9(8).
03 COL-OTR-REF PIC X(20).
03 COL-VER-BNR PIC 9(4)
COMP.
03 COL-TRAN-SEQ PIC X(9).
----------------------------------------------------------------------
--------

When I import the above structure It considered the COMP-3 as decimal.
Then as per examples I specified the NLS to None for CFF Stage and in
the transformation I mentioned for the COL-AMT-2 like this
"DataTypePicComp3( DSLink17.COL_AMT_2)"

In the output for that column I getting the value like this
"323032303230323" The actual should be 2639.63.

Can anyone help me how to get value for the COMP-3 & COMP types.



Thanks with Regards,
Thiruma Valavan.
Visit us on www.alfransi.com.sa
====== Banque Saudi Fransi - Privacy Notice ====== This message is
intended only for the person or entity to which it is addressed and
may contain confidential and/or privileged material. Any use of this
information by persons or entities other than the intended recipient
is prohibited. If you have received this in error, please contact
the sender and delete the material from your computer. Any opinions
and other information contained in this message that do not relate to
the official business of Banque Saudi Fransi shall be understood
as neither given or endorsed by it.
====== Banque Saudi Fransi - Privacy Notice ======
<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

Reading COBOL File to Sequence file - COMP-3 conversion.

Post by admin »

The CFF stage will/should take care of all your needs.

ALWAYS ALWAYS ALWAYS (at least almost always), FTP the file from MF to UNIX
or NT as BINARY, especially if the data contains packed (COMP, COMP-3) data
(as state by an earlier poster).

Use the CFF stage to read the data into the DS job. Specific EBCDIC for
Data
Format and BINARY for Record style. Load the table def that DS creates from

the COBOL FD.

You should have no problems.

No need to use the DS transforms/routines that do the EBCDIC->ASCII and
Packed to Unpacked conversions. That is all done inside the CFF stage.

It is a very powerful stage, and it was created for this purpose.

-Craig Rouse
Griffin Resources, Inc
griffin.resources@att.net

-----Original Message-----
From: Craig Hulett [mailto:Craig.Hulett@comcast.net]
Sent: Wednesday, January 14, 2004 7:15 PM
To: datastage-users@oliver.com
Subject: RE: Reading COBOL File to Sequence file - COMP-3 conversion.


Exactly. Packed Decimal fields like COMP-3 are identical in ASCII or EBCDIC
files. Converting them either way turns them into garbage. So you'll need
to do the EBCDIC conversions inside DataStage for the character strings and
handle the COMP-3 conversions separately. I haven't used the CFF stage, but
in general when doing this kind of conversion you define the input side as a
character field, size including sign / 2 (rounded up). For example,

Size of S9(3)V9(8) COMP-3 = CHAR(6) (11+1 / 2)
Size of S(15) COMP-3 = CHAR(8) (15+1 / 2)

Define them as character fields, apply the COMP-3 conversion functions and
then output them to the proper numeric format.

-craig

-----Original Message-----
From: Shawn Ramsey [mailto:SRamsey@starbucks.com]
Sent: Wednesday, January 14, 2004 10:08 AM
To: datastage-users@oliver.com
Subject: RE: Reading COBOL File to Sequence file - COMP-3 conversion.


We have ran into the same issue. We had folks that were FTPing the files as
ASCII from our AS/400 and I spent a lot of time in the Hex Editor before I
figured out what they had done. Text mode FTP works fine as long as all of
the fields are formatted as character types but it causes problems with the
binary encoded data (such as the COMP-3) data. You will need to FTP the
file in binary mode and use both the EBCDIC-ASCII conversion as well as the
COMP-3 conversion functions to read the data.

-----Original Message-----
From: Len O'Toole [mailto:lenotoole2@cox-internet.com]
Sent: Wednesday, January 14, 2004 8:46 AM
To: datastage-users@oliver.com
Subject: RE: Reading COBOL File to Sequence file - COMP-3 conversion.


Something to check...

If you moved your file from the mainframe to another platform like UNIX, did
you indicate to the FTP software that the source file was EBCDIC ?
Mainframes operate with an EBCDIC character set. Unix operates with an ASCII
character set. Failure to convert to ASCII will result in garbage / corrupt
data in your file. This could be one possible cause...

Len O'Toole

-----Original Message-----
From: TValavan@AlFransi.com.sa [mailto:TValavan@AlFransi.com.sa]
Sent: Wednesday, January 14, 2004 9:45 AM
To: datastage-users@oliver.com
Subject: Reading COBOL File to Sequence file - COMP-3 conversion.





Hi ALL,

Gurus, I am getting a COBOL file from Mainframe and the structure
look
like this.

----------------------------- COBOL file structure
----------------------
01 MFBTW-BTWCOL.
02 COL-REC.
03 COL-REC-KEY.
04 COL-BRH-REF PIC X(7).
04 COL-TRAN-GRP PIC X(5).
04 COL-CPTY-TWO PIC X(7).
04 COL-TRAN-ID PIC X(6).
03 COL-RTE PIC S9(3)V9(8)
COMP-3.
03 COL-AMT-2 PIC S9(15)
COMP-3.
03 COL-COM-ACR-DTE PIC 9(8).
03 COL-OTR-REF PIC X(20).
03 COL-VER-BNR PIC 9(4)
COMP.
03 COL-TRAN-SEQ PIC X(9).
----------------------------------------------------------------------
--------

When I import the above structure It considered the COMP-3 as decimal. Then
as per examples I specified the NLS to None for CFF Stage and in the
transformation I mentioned for the COL-AMT-2 like this "DataTypePicComp3(
DSLink17.COL_AMT_2)"

In the output for that column I getting the value like this
"323032303230323" The actual should be 2639.63.

Can anyone help me how to get value for the COMP-3 & COMP types.



Thanks with Regards,
Thiruma Valavan.
Visit us on www.alfransi.com.sa
====== Banque Saudi Fransi - Privacy Notice ====== This message is
intended only for the person or entity to which it is addressed and may
contain confidential and/or privileged material. Any use of this information
by persons or entities other than the intended recipient is prohibited. If
you have received this in error, please contact the sender and delete the
material from your computer. Any opinions and other information contained
in this message that do not relate to the official business of Banque
Saudi Fransi shall be understood as neither given or endorsed by it. ======
Banque Saudi Fransi - Privacy Notice ======
<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

Reading COBOL File to Sequence file - COMP-3 conversion.

Post by admin »

Sorry by a stupid question, but what is the CFF stage ?


Guillermo P. Barsky - gbarsky@osde.com.ar
Gerencia de Sistemas - Desarrollo

OSDE Binario - Filial Metropolitana
Alem 1067, Piso 16
TE (5411)4510-4330, Fax (5411)4510-5480
http://www.osde.com.ar



"Craig Rouse"

att.net> cc:
Asunto: RE: Reading COBOL File to Sequence file - COMP-3 conversion.
15/01/2004 12:31
a.m.
Por favor, responda
a datastage-users






The CFF stage will/should take care of all your needs.

ALWAYS ALWAYS ALWAYS (at least almost always), FTP the file from MF to UNIX

or NT as BINARY, especially if the data contains packed (COMP, COMP-3) data

(as state by an earlier poster).

Use the CFF stage to read the data into the DS job. Specific EBCDIC for
Data
Format and BINARY for Record style. Load the table def that DS creates
from

the COBOL FD.

You should have no problems.

No need to use the DS transforms/routines that do the EBCDIC->ASCII and
Packed to Unpacked conversions. That is all done inside the CFF stage.

It is a very powerful stage, and it was created for this purpose.

-Craig Rouse
Griffin Resources, Inc
griffin.resources@att.net

-----Original Message-----
From: Craig Hulett [mailto:Craig.Hulett@comcast.net]
Sent: Wednesday, January 14, 2004 7:15 PM
To: datastage-users@oliver.com
Subject: RE: Reading COBOL File to Sequence file - COMP-3 conversion.


Exactly. Packed Decimal fields like COMP-3 are identical in ASCII or EBCDIC
files. Converting them either way turns them into garbage. So you'll need
to do the EBCDIC conversions inside DataStage for the character strings and
handle the COMP-3 conversions separately. I haven't used the CFF stage,
but
in general when doing this kind of conversion you define the input side as
a
character field, size including sign / 2 (rounded up). For example,

Size of S9(3)V9(8) COMP-3 = CHAR(6) (11+1 / 2)
Size of S(15) COMP-3 = CHAR(8) (15+1 / 2)

Define them as character fields, apply the COMP-3 conversion functions and
then output them to the proper numeric format.

-craig

-----Original Message-----
From: Shawn Ramsey [mailto:SRamsey@starbucks.com]
Sent: Wednesday, January 14, 2004 10:08 AM
To: datastage-users@oliver.com
Subject: RE: Reading COBOL File to Sequence file - COMP-3 conversion.


We have ran into the same issue. We had folks that were FTPing the files
as
ASCII from our AS/400 and I spent a lot of time in the Hex Editor before I
figured out what they had done. Text mode FTP works fine as long as all of
the fields are formatted as character types but it causes problems with the
binary encoded data (such as the COMP-3) data. You will need to FTP the
file in binary mode and use both the EBCDIC-ASCII conversion as well as the
COMP-3 conversion functions to read the data.

-----Original Message-----
From: Len O'Toole [mailto:lenotoole2@cox-internet.com]
Sent: Wednesday, January 14, 2004 8:46 AM
To: datastage-users@oliver.com
Subject: RE: Reading COBOL File to Sequence file - COMP-3 conversion.


Something to check...

If you moved your file from the mainframe to another platform like UNIX,
did
you indicate to the FTP software that the source file was EBCDIC ?
Mainframes operate with an EBCDIC character set. Unix operates with an
ASCII
character set. Failure to convert to ASCII will result in garbage / corrupt
data in your file. This could be one possible cause...

Len O'Toole

-----Original Message-----
From: TValavan@AlFransi.com.sa [mailto:TValavan@AlFransi.com.sa]
Sent: Wednesday, January 14, 2004 9:45 AM
To: datastage-users@oliver.com
Subject: Reading COBOL File to Sequence file - COMP-3 conversion.





Hi ALL,

Gurus, I am getting a COBOL file from Mainframe and the structure
look
like this.

----------------------------- COBOL file structure
----------------------
01 MFBTW-BTWCOL.
02 COL-REC.
03 COL-REC-KEY.
04 COL-BRH-REF PIC X(7).
04 COL-TRAN-GRP PIC X(5).
04 COL-CPTY-TWO PIC X(7).
04 COL-TRAN-ID PIC X(6).
03 COL-RTE PIC S9(3)V9(8)
COMP-3.
03 COL-AMT-2 PIC S9(15)
COMP-3.
03 COL-COM-ACR-DTE PIC 9(8).
03 COL-OTR-REF PIC X(20).
03 COL-VER-BNR PIC 9(4)
COMP.
03 COL-TRAN-SEQ PIC X(9).
----------------------------------------------------------------------
--------

When I import the above structure It considered the COMP-3 as decimal. Then
as per examples I specified the NLS to None for CFF Stage and in the
transformation I mentioned for the COL-AMT-2 like this "DataTypePicComp3(
DSLink17.COL_AMT_2)"

In the output for that column I getting the value like this
"323032303230323" The actual should be 2639.63.

Can anyone help me how to get value for the COMP-3 & COMP types.



Thanks with Regards,
Thiruma Valavan.
Visit us on www.alfransi.com.sa
====== Banque Saudi Fransi - Privacy Notice ====== This message is
intended only for the person or entity to which it is addressed and may
contain confidential and/or privileged material. Any use of this
information
by persons or entities other than the intended recipient is prohibited. If
you have received this in error, please contact the sender and delete the
material from your computer. Any opinions and other information
contained
in this message that do not relate to the official business of Banque
Saudi Fransi shall be understood as neither given or endorsed by it.
======
Banque Saudi Fransi - Privacy Notice ======
<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

Reading COBOL File to Sequence file - COMP-3 conversion.

Post by admin »

A Stage in DataStage used to access data that originated from a
mainframe. CFF = 'Complex Flat File'.

-----Original Message-----
From: gbarsky@osde.com.ar [mailto:gbarsky@osde.com.ar]
Sent: Thursday, January 15, 2004 9:54 AM
To: datastage-users@oliver.com
Subject: RE: Reading COBOL File to Sequence file - COMP-3 conversion.





Sorry by a stupid question, but what is the CFF stage ?


Guillermo P. Barsky - gbarsky@osde.com.ar Gerencia de Sistemas -
Desarrollo

OSDE Binario - Filial Metropolitana
Alem 1067, Piso 16
TE (5411)4510-4330, Fax (5411)4510-5480
http://www.osde.com.ar




"Craig Rouse"



att.net> cc:

Asunto: RE: Reading
COBOL File to Sequence file - COMP-3 conversion.
15/01/2004 12:31

a.m.

Por favor, responda

a datastage-users









The CFF stage will/should take care of all your needs.

ALWAYS ALWAYS ALWAYS (at least almost always), FTP the file from MF to
UNIX

or NT as BINARY, especially if the data contains packed (COMP, COMP-3)
data

(as state by an earlier poster).

Use the CFF stage to read the data into the DS job. Specific EBCDIC
for Data Format and BINARY for Record style. Load the table def that
DS creates from

the COBOL FD.

You should have no problems.

No need to use the DS transforms/routines that do the EBCDIC->ASCII
and Packed to Unpacked conversions. That is all done inside the CFF
stage.

It is a very powerful stage, and it was created for this purpose.

-Craig Rouse
Griffin Resources, Inc
griffin.resources@att.net

-----Original Message-----
From: Craig Hulett [mailto:Craig.Hulett@comcast.net]
Sent: Wednesday, January 14, 2004 7:15 PM
To: datastage-users@oliver.com
Subject: RE: Reading COBOL File to Sequence file - COMP-3 conversion.


Exactly. Packed Decimal fields like COMP-3 are identical in ASCII or
EBCDIC files. Converting them either way turns them into garbage. So
you'll need to do the EBCDIC conversions inside DataStage for the
character strings and handle the COMP-3 conversions separately. I
haven't used the CFF stage, but in general when doing this kind of
conversion you define the input side as a character field, size
including sign / 2 (rounded up). For example,

Size of S9(3)V9(8) COMP-3 = CHAR(6) (11+1 / 2)
Size of S(15) COMP-3 = CHAR(8) (15+1 / 2)

Define them as character fields, apply the COMP-3 conversion functions
and then output them to the proper numeric format.

-craig

-----Original Message-----
From: Shawn Ramsey [mailto:SRamsey@starbucks.com]
Sent: Wednesday, January 14, 2004 10:08 AM
To: datastage-users@oliver.com
Subject: RE: Reading COBOL File to Sequence file - COMP-3 conversion.


We have ran into the same issue. We had folks that were FTPing the
files as ASCII from our AS/400 and I spent a lot of time in the Hex
Editor before I figured out what they had done. Text mode FTP works
fine as long as all of the fields are formatted as character types but
it causes problems with the binary encoded data (such as the COMP-3)
data. You will need to FTP the file in binary mode and use both the
EBCDIC-ASCII conversion as well as the
COMP-3 conversion functions to read the data.

-----Original Message-----
From: Len O'Toole [mailto:lenotoole2@cox-internet.com]
Sent: Wednesday, January 14, 2004 8:46 AM
To: datastage-users@oliver.com
Subject: RE: Reading COBOL File to Sequence file - COMP-3 conversion.


Something to check...

If you moved your file from the mainframe to another platform like
UNIX, did you indicate to the FTP software that the source file was
EBCDIC ?
Mainframes operate with an EBCDIC character set. Unix operates with an
ASCII character set. Failure to convert to ASCII will result in
garbage / corrupt data in your file. This could be one possible
cause...

Len O'Toole

-----Original Message-----
From: TValavan@AlFransi.com.sa [mailto:TValavan@AlFransi.com.sa]
Sent: Wednesday, January 14, 2004 9:45 AM
To: datastage-users@oliver.com
Subject: Reading COBOL File to Sequence file - COMP-3 conversion.





Hi ALL,

Gurus, I am getting a COBOL file from Mainframe and the structure
look
like this.

----------------------------- COBOL file structure
----------------------
01 MFBTW-BTWCOL.
02 COL-REC.
03 COL-REC-KEY.
04 COL-BRH-REF PIC X(7).
04 COL-TRAN-GRP PIC X(5).
04 COL-CPTY-TWO PIC X(7).
04 COL-TRAN-ID PIC X(6).
03 COL-RTE PIC S9(3)V9(8)
COMP-3.
03 COL-AMT-2 PIC S9(15)
COMP-3.
03 COL-COM-ACR-DTE PIC 9(8).
03 COL-OTR-REF PIC X(20).
03 COL-VER-BNR PIC 9(4)
COMP.
03 COL-TRAN-SEQ PIC X(9).
----------------------------------------------------------------------
--------

When I import the above structure It considered the COMP-3 as decimal.
Then as per examples I specified the NLS to None for CFF Stage and in
the transformation I mentioned for the COL-AMT-2 like this
"DataTypePicComp3( DSLink17.COL_AMT_2)"

In the output for that column I getting the value like this
"323032303230323" The actual should be 2639.63.

Can anyone help me how to get value for the COMP-3 & COMP types.



Thanks with Regards,
Thiruma Valavan.
Visit us on www.alfransi.com.sa
====== Banque Saudi Fransi - Privacy Notice ====== This message is
intended only for the person or entity to which it is addressed and
may contain confidential and/or privileged material. Any use of this
information by persons or entities other than the intended recipient
is prohibited. If you have received this in error, please contact
the sender and delete the material from your computer. Any opinions
and other information contained in this message that do not relate to
the official business of Banque Saudi Fransi shall be understood
as neither given or endorsed by it.
======
Banque Saudi Fransi - Privacy Notice ======
<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