how to convert ascii to EBCDIC format

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

Post Reply
harish_s_ampeo
Participant
Posts: 26
Joined: Tue Dec 18, 2007 6:31 am

how to convert ascii to EBCDIC format

Post by harish_s_ampeo »

Hi All,
Iam using ebcdic() function to convert the below input data's from Ascii to Ebcdic format, but the function is not converting the data as required.
Iam passing the input data ebcdic(sign&Deci data) this throws data truncation warning in spite of givign datalength as 7.And for ebcdic(sign data) its not converting as required.

src(odbc)-------->Trm--------->seq file(fixed width.dat file)

scenario || Input data || MF datatype || start || end || MF data length
sign data || +12345 || S9(5) || 1 || 5 || 5
sign data || -00123 || S9(5) || 1 || 5 || 5
sign&Deci|| +12345.12|| S9(5)V9(2) || 6 || 12 || 7
sign&Deci|| -12342.12 || S9(5)V9(2) || 13 || 19 || 7

Note: || are used to seperate
Please suggest me if any code correction to be made in the job/transf to get desired result.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That function is only valid for character data, for those (I assume) packed fields you just need to 'unpack' them. Or are they not packed? Also, have you tried the CFF stage?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In DataStage server, in which all data are treated as character strings, S9(5)V99 requires nine character positions, not seven; one for the sign character, seven for the digits and one for the decimal placeholder character.

Similarly, S9(5) requires six character positions; one for the sign and five for the digits.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
harish_s_ampeo
Participant
Posts: 26
Joined: Tue Dec 18, 2007 6:31 am

Post by harish_s_ampeo »

Hi Craig,

we cann't use CFF stage in the target stage. It can only be used as the source stage and i need to convert ascii data to MF data. I got to know that Ebcdic() function cann't be used to convert signed integer and signed decimal to MF code.Please help me if any routine or code has to be written to convert to signed decimal and signed integer to MF data.

Thanks in advance
Harish
Post Reply