Conversion problem of High values using CFF stage

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
mrvsr
Premium Member
Premium Member
Posts: 40
Joined: Fri Aug 03, 2007 8:33 am

Conversion problem of High values using CFF stage

Post by mrvsr »

Hi All,

Please help me handling HIGH values in Complex flat file stage.

I am reading a cobol file using complex flat file stage and writing to sequential file.
one field got defined as PIC X and got HIGH values in the source mainframe file.
I am getting Junk () as out put in sequential file for that field Char(1).

Same thing with comp-3 fields.

One comp-3 field is filled with HIGH values another with ZERO.

Both the fields got associated redefined fields But in out put of first
redefined field is junk and another field is space.

Please let me know how to handle these high values using complex flat file stage.

5 MAX-F PIC S9(13)V99 COMP-3. (Position 107)
5 MAX-FV REDEFINES MAX-F PIC X(8 ).
........................
........................
5 FEE PIC S9(13)V99 COMP-3. (Position 142)
5 FEE-HV REDEFINES FEE PIC X(8 ).


MAX_F/MAX_FV____________________________ FEE/FEE_HV
107 position_______________________________ 142 position
................................ . ...... .... ............
FFFFFFFFFFFFFFF 00F000000000000014 000000 00F000000000000004
FFFFFFFFFFFFFFF 0FF0000100C00000C0 00000C 0FF0000000C00000C0
High Values__________________________________ Zero


Out put

MAX_F : 0000000000000.00.
MAX_FV :
FEE : 0000000000000.00
FEE_HV : (Spaces)


Please let me know how can I get spaces in redefined MAX_FV Field when its original field MAX_F got HIGH values.
and how can I get spaces in the sequential file fields when these fields got HIGH values in source file.


Thanks
Thanks
MRVSR
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Without looking further into the issue, I do know that the High-Value of a PIC X and PIC S9 COMP-3 are different values so that if the are in the same location, as specified with the REDEFINES, you can only use one or the other.

It would seem that MAX-FV was set with high value, making the value of FV invalid. The second group is stranger, as it is neither high-value nor is the first row a valid COMP-3 as the rightmost character, "04" is not a valid sign ("C0" is, I think, the correct trailing positive sign)
mrvsr
Premium Member
Premium Member
Posts: 40
Joined: Fri Aug 03, 2007 8:33 am

Post by mrvsr »

Thanks ArndW for your reply.

I created a simple file in mainframe with rec length 10 using ISPF editor
assuming character HIGH VALUES as FF ( correct me if I am wrong)

did ftp in binary mode.

infld1 pix x(1)
infld2 pix x(1) # high val field
infld3 pix x(7)
infld4 pix x(1)



..1111111a ---> actual data

4FFFFFFFF8 ---> Hex data.
0F11111F1


infld2 field defined as PIC X and got HIGH values in the source mainframe file.

My job design is

CFF -----> BasicTransfrmr---------> Seq file

But when I did read this file using complex flat file stage as.

infld1 char(1)
infld2 char(1) # high val field
infld3 char(7)
infld4 char(1)

And writing to sequential file.

In seq file infld2 got junk () character in it.

when I do seq(DataTypeEbcdicToAscii( infld2 )) I am getting value of 137

I was expecting 255 or 127 but I dont know why I am getting 137

I tried all the combinations of record and field option in the CFF stage like default value, field width, null value, sign etc.,

But I am not getting space when there is a HIGH VALUE( FF ) for char data types in the input field.

Please let me know how to get spaces for fields
( Char(1)=FF/ Char(3)=FFFFFF ) got high values (FF) in the source mainframe file.


Thanks
Thanks
MRVSR
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

COBOL has the concept of "high value" but other languages do not. You have a 0xFF value as high value coming in, but as that is not defined as a standard EBCDIC character there is also no defined conversion for it in ASCII. If you wish to convert these character high-values to spaces, do a "CONVERT(Char(255),Char(64),In.ColumnName)". 64 is the decimal representation of an EBCDIC space.
Post Reply