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!

Problem with %CHAR in V5R1

Status
Not open for further replies.

flapeyre

Programmer
Nov 22, 2002
2,356
US
Hi. I'm trying to create a string with the user, date, and time from a file:
Code:
     C                   Eval      Error_msg = %TRIM(Bpcusr) + ' ' +            
     C                             + %TRIM(%CHAR(%DATE(Bpcdat:*CYMD) : *JOBRUN))
     C                             + ' '                                        
     C                             + %TRIM(%CHAR(%TIME(Bpctim:*HMS) : *JOBRUN))

Bpcusr is 10 bytes, character. Bpcdat is 7,0 packed in CYYMMDD format, and Bpctim is 6,0 packed in hhmmss format.

The program gives the following error message when I compile:

Code:
*RNF7421 30        056700  Operands are not compatible with the type of operator.

What's going on? According to the V5R1 manual, this should work. What am I doing wrong?


"When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for here you have been, and there you will always long to return."

--Leonardo da Vinci

 
I might add that I tried to simplify this by using %CHAR directly on date-type and time-type fields - it made no difference. So it's the %CHAR function which isn't behaving as the manual said it would.


"When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for here you have been, and there you will always long to return."

--Leonardo da Vinci

 
Never mind; I found the problem.


"When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for here you have been, and there you will always long to return."

--Leonardo da Vinci

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top