View previous topic :: View next topic |
Author |
Message |
prabhutp Beginner
Joined: 02 Feb 2005 Posts: 20 Topics: 11
|
Posted: Mon May 30, 2005 4:38 am Post subject: DSNH312I Error |
|
|
Hi
I have query in my cobol,DB2 program as
Exec SQL
SET :WS-EXP-DT = CURRENT DATE + :WS-RETENTION-PD DAYS
End-Exec
I have declared the variables as
03 WS-EXP-DT PIC X(10) VALUE SPACES.
03 WS-RETENTION-PD PIC 9(04) VALUE ZEROES.
But the error message I receive in compilation is DSNH312I - Undefined or unusable Host variable WS-RETENTION-PD.
Kindly help _________________ tp |
|
Back to top |
|
 |
acevedo Beginner

Joined: 03 Dec 2002 Posts: 127 Topics: 0 Location: Europe
|
Posted: Mon May 30, 2005 8:59 am Post subject: |
|
|
try
03 ws-retention-pd pic s9(07) comp-3 value zeroes.
hth |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Mon May 30, 2005 3:01 pm Post subject: |
|
|
prabhutp,
you simply define
Code: |
03 WS-RETENTION-PD PIC S9(04) COMP VALUE ZEROES.
|
acevedo's solution will work fine, but why waste another additional byte, just define it as 2 bytes
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
prabhutp Beginner
Joined: 02 Feb 2005 Posts: 20 Topics: 11
|
Posted: Wed Jun 01, 2005 12:03 am Post subject: |
|
|
Thanks for the reply..It worked..But,can you please explain the funda behind it.I thought COMP is primarily for storage purpose.
Kindly explain _________________ tp |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
|
|