Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image datatype

Status
Not open for further replies.

uccio98

Technical User
Jun 23, 2004
2
IT
I need to read image sql server datatype in a cobol futjitsu program but i have no idea how to say to the program to threat this field as binary and not char (i use pic x(15000), perhaps this is the foult)
thank's for help
Antonio
 
I must admit I never worked with images in COBOL.
To me x(15000) should work.

But realise that this area will always be filled with trailing spaces!
If you know the exact(!) length, than
you may be able to use something like the following record definition:
Code:
01  imageData.
  05  imageLength  PIC  9(18).
  05  theImage     PIC  X(200000).
assuming that:
[A] An image is never larger than approx. 195Kb.
All bytes are used completely(!), up til and including the last byte.

Alphanumeric moves should not change the bit pattern.
However(!), when you move between an EBCDIC and an ASCII code based system then the move must be binary (or something similar).
Otherwise the system may attempt to translate any byte that resembles a character from the used character set.

Note!
There might be 1 or more special COBOL (vendor) extensions for exactly this kind of problem (similar like the field types defined for DB2).
In that case I hope somebody else, more knowledgeable, will reply to this post.

Regards, Wim Ahlers.
 
Thank's for your answer, i forgot in my last message to say we are using embedded sql.
image field is part of a composed table.
Ciao
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top