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

SD Clause Syntex


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

New User


Joined: 22 Feb 2007
Posts: 10
Location: pune

PostPosted: Mon Dec 17, 2007 3:17 pm
Reply with quote

hi
i want to create an output file while sorting the records so under DATA DIVISION in File Section i am giving SD clause.
Can any one suggest me the syntex for that
i am giving it as

SD DIALONE-FILE
RECORD CONTAINS 760 CHARACTERS
DATA RECORD IS DIALONE-REC PIC X(760).

please tell me whatall changes i need to do there.
Back to top
View user's profile Send private message
guptaa

New User


Joined: 22 Feb 2007
Posts: 10
Location: pune

PostPosted: Mon Dec 17, 2007 3:30 pm
Reply with quote

hi murali
can u tell me what all changes are required in the above syntex.
the error message i am getting is
""DIALONE-FILE" was defined as a type that was invalid in this context." and
"Expected a record-name, but found "DIALONE-REC". The statement was discarded."
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon Dec 17, 2007 3:48 pm
Reply with quote

For starers....
Code:
SD  DIALONE-FILE                                                 
    RECORD CONTAINS 760 CHARACTERS                               
    DATA RECORD IS  DIALONE-REC
01 DIALONE-REC                       PIC X(760).

I really do not think that you are going to get what you want this way.....
Read the language reference: Data Division--file description entries
and the programming guide: Sorting and merging files
Back to top
View user's profile Send private message
guptaa

New User


Joined: 22 Feb 2007
Posts: 10
Location: pune

PostPosted: Mon Dec 17, 2007 3:58 pm
Reply with quote

i have used the above code but still getting the same error.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon Dec 17, 2007 4:01 pm
Reply with quote

Not enough information, try again.....
Back to top
View user's profile Send private message
guptaa

New User


Joined: 22 Feb 2007
Posts: 10
Location: pune

PostPosted: Mon Dec 17, 2007 5:02 pm
Reply with quote

is there any specific condition needs to be handle while opening or closing such files..
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon Dec 17, 2007 5:13 pm
Reply with quote

guptaa wrote:
i have used the above code but still getting the same error.
I don't think so, what error with what syntax?
Quote:
is there any specific condition needs to be handle while opening or closing such files..
You don't open or close SD files, the sort does.
Please:
CICS Guy wrote:
Read the language reference: Data Division--file description entries
and the programming guide: Sorting and merging files
and
Quote:
Not enough information, try again.....
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Mon Dec 17, 2007 5:26 pm
Reply with quote

Ashish Gupta,

Could you please give the Error code?
Back to top
View user's profile Send private message
guptaa

New User


Joined: 22 Feb 2007
Posts: 10
Location: pune

PostPosted: Mon Dec 17, 2007 6:14 pm
Reply with quote

while compiling i am getting return code 12 and message is
"3560 IGYPS2143-S Expected a record-name, but found "DIALONE-REC".
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon Dec 17, 2007 6:17 pm
Reply with quote

Hopeless..... icon_rolleyes.gif
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Mon Dec 17, 2007 6:31 pm
Reply with quote

Gupta,

The same syntax is working fine in my Env..,
I am using IBM ENTERPRISE COBOL FOR Z/OS 3.4.1
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Dec 17, 2007 9:46 pm
Reply with quote

Hello guptaa,

If you want help from the forum, you have to do a more complete job explaining/posting what is not working as you want.

If you post the SELECTs, the FDs/SDs, and the OPEN/CLOSE and SORT statements, we may be better able to give you assistance rather than continuing to "toss the ball" back and forth,
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 To search DB2 table based on Conditio... DB2 1
No new posts NOT IN clause in COBOL pgm COBOL Programming 8
No new posts SUSBSCRIPT WITH SIGN IN PIC CLAUSE COBOL Programming 3
No new posts usage of CASE in WHERE clause DB2 10
No new posts Cobol redefines for Signed pictured c... COBOL Programming 4
Search our Forums:

Back to Top