I am getting error in AS400 CL program when trying to declare field with type GRAPH

98 Views Asked by At

I am getting error in CL program when trying to declare tablewith "Graphic field". Type "GRAPH"

DCLF FILE(MYTABLE)

  • CPD085C 40 Graphic field not allowed for variable &DESC.

Is there any way around this?

OS: V7R4M0

1

There are 1 best solutions below

1
nfgl On BEST ANSWER

CL doesn't handle graphic types, you can find workarounds in the message full help :

Message . . . . : Graphic field not allowed for variable &1.
Cause . . . . . : A graphic field was found, but ALWGRAPHIC(*NO) on the DCLF command was defaulted or specified.
Recovery . . . : Specify ALWGRAPHIC(*YES) on the DCLF command, or specify a file or record format that does not contain graphic fields.

ALWGRAPHIC(*YES) will create a CHAR(x) that will be large enough to contain any binary value of DESC. If you have to use DESC (compare, modify, ...), it would be better to use a language that knows graphic types.