IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

An error during CICS precompilation


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dineshsjce
Currently Banned

New User


Joined: 16 Apr 2007
Posts: 41
Location: Bangalore

PostPosted: Tue May 29, 2007 2:11 pm
Reply with quote

Hi I treid executing a CICS proigram in unix. I got an error saying that
An unexpected token "UNION
" was found following "FF_DT > CURRENT DATE". Expected
tokens may include: "<space>". SQLSTATE=42601

Can anybody please help me in solving this problem ?

This is the piece of code whare I am getting error.

EXEC SQL
SELECT 'Y'
INTO :WS-FUTURE-EXIST-SW
FROM CON01_CUST_CNTCT
WHERE
AID_CD = :WS-AID-CD-ONLY
AND COMP_CD IS NULL
AND PRICGRP_CD IS NULL
AND CUST_NBR IS NULL
AND CNTCT_PURP_CD = :WS-PURPOSE-CD-IDP
AND CNTCT_EFF_DT > CURRENT DATE
UNION
SELECT 'Y'
INTO :WS-FUTURE-EXIST-SW
FROM CON01_CUST_CNTCT
WHERE
AID_CD = :WS-AID-CD-COMP
AND COMP_CD = :WS-COMP-CD
AND PRICGRP_CD IS NULL
AND CUST_NBR IS NULL
AND CNTCT_PURP_CD = :WS-PURPOSE-CODE
AND CNTCT_EFF_DT > CURRENT DATE
UNION
SELECT 'Y'
INTO :WS-FUTURE-EXIST-SW
FROM CON01_CUST_CNTCT
WHERE
AID_CD = :WS-AID-CD-PRICE
AND COMP_CD IS NULL
AND PRICGRP_CD = :WS-PRICGRP-CD
AND CUST_NBR IS NULL
AND CNTCT_PURP_CD = :WS-PURPOSE-CD-IDP
AND CNTCT_EFF_DT > CURRENT DATE
UNION
SELECT 'Y'
INTO :WS-FUTURE-EXIST-SW
FROM CON01_CUST_CNTCT
WHERE
AID_CD IS NULL
AND COMP_CD IS NULL
AND PRICGRP_CD IS NULL
AND CUST_NBR = :WS-CUST-NBR
AND CNTCT_PURP_CD = :WS-PURPOSE-CD-IDP
AND CNTCT_EFF_DT > CURRENT DATE
UNION
SELECT 'Y'
INTO :WS-FUTURE-EXIST-SW
FROM CON01_CUST_CNTCT
WHERE
AID_CD IS NULL
AND COMP_CD IS NULL
AND PRICGRP_CD IS NULL
AND CUST_NBR IS NULL
AND DHL_CUST_ID = :WS-CSTMR-ID
AND DHL_TRF_ID = :WS-TARIFF-AG
AND CNTCT_PURP_CD = :WS-PURPOSE-CODE
AND CNTCT_EFF_DT > CURRENT DATE
UNION
SELECT 'Y'
INTO :WS-FUTURE-EXIST-SW
FROM CON01_CUST_CNTCT
WHERE
AID_CD IS NULL
AND COMP_CD IS NULL
AND PRICGRP_CD IS NULL
AND CUST_NBR IS NULL
AND DHL_CUST_ID IS NULL
AND DHL_TRF_ID = :WS-TARIFF-AG
AND CNTCT_PURP_CD = :WS-PURPOSE-CODE
AND CNTCT_EFF_DT > CURRENT DATE
END-EXEC.
Back to top
View user's profile Send private message
pingte

Active User


Joined: 03 Dec 2005
Posts: 120
Location: india

PostPosted: Tue May 29, 2007 3:12 pm
Reply with quote

Can union be used without cursor .. in embedded sql?
Back to top
View user's profile Send private message
dineshsjce
Currently Banned

New User


Joined: 16 Apr 2007
Posts: 41
Location: Bangalore

PostPosted: Tue May 29, 2007 3:42 pm
Reply with quote

The same program is compiled in mainframe
Back to top
View user's profile Send private message
pingte

Active User


Joined: 03 Dec 2005
Posts: 120
Location: india

PostPosted: Tue May 29, 2007 3:48 pm
Reply with quote

dineshsjce wrote:
The same program is compiled in mainframe


UNION will retrieve more than one row more often than not.

How can you handle more than one row without using cursor icon_idea.gif

hope i have been able to put my point across... icon_rolleyes.gif

so even if the program compiles .. i think it will abend at run time....

Correct me if i am wrong icon_arrow.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Calling an Open C library function in... CICS 1
Search our Forums:

Back to Top