MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Order By Clause

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
syandra
Beginner


Joined: 26 May 2003
Posts: 19
Topics: 6

PostPosted: Mon Dec 27, 2004 1:45 am    Post subject: Order By Clause Reply with quote

Hi all,

I am trying to compile a cobol program with the following SQL

EXEC SQL
SELECT NNEGSC_RSN_CD
,SR_SC_PS_ENT_DT
,AT_QY
,AT_SR_ITM_CD
,SR_AT_DSC_TX
,TD_ORI_EX_CD
,AT_AP_IP_TR_NO
,CHAR(SR_SC_PS_ENT_DT) ||
ML_AC_NO ||
NNEGSC_RSN_CD ||
CHAR(SR_AT_RC_ID)
INTO
:ATY-NNEGSC-RSN-CD
,:ATY-SR-SC-PS-ENT-DT
,:ATY-AT-QY
,:ATY-AT-SR-ITM-CD
,:ATY-SR-AT-DSC-TX
,:ATY-TD-ORI-EX-CD
,:ATY-AT-AP-IP-TR-NO
,:PARM-CONCAT-PREV-KEY
FROM V1SABWES
WHERE SR_ITL_ML_LGEY_CD = :ATY-SR-ITL-ML-LGEY-CD
AND SR_SC_PS_ENT_DT >= :ATY-SR-SC-PS-ENT-DT
AND ( CHAR(SR_SC_PS_ENT_DT) ||
ML_AC_NO ||
NNEGSC_RSN_CD ||
CHAR(SR_AT_RC_ID) ) > :PARM-CONCAT-PREV-KEY
ORDER BY
SR_SC_PS_ENT_DT
,NNEGSC_RSN_CD
FETCH FIRST ROW ONLY
END-EXEC.


The following error is displayed ...

0DSNH109I E DSNHAPLY LINE 267 COL 17 "ORDER BY" CLAUSE NOT PERMITTED


Can anyone help me out in resolving this..

Thanks,
Sukumar
Back to top
View user's profile Send private message
syandra
Beginner


Joined: 26 May 2003
Posts: 19
Topics: 6

PostPosted: Mon Dec 27, 2004 5:57 am    Post subject: Reply with quote

Thanks to all... I got the answer....

We cannot use ORDER BY clause in an embedded SELECT clause..


Sukumar
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group