Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Internal sort not able to execute

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
sravz chinnu

New User


Joined: 07 Dec 2011
Posts: 26
Location: India

PostPosted: Mon Jan 23, 2012 5:10 pm    Post subject: Internal sort not able to execute
Reply with quote

Hello,
I am trying to execute a cobol program using internal sort . i am getting below error in spool. Please help me out to resolve this. I did not understand that do we really need to open input file in sort? Please suggest.


IGZ0035S There was an unsuccessful OPEN or CLOSE of file INFILE in program INTER at relative location X'04DA'.
Neither FILE STATUS nor an ERROR declarative were specified. The status code was 90.
From compile unit INTER at entry point INTER at compile unit offset +000004D8 at entry offset +000004D8 at
address 29900D50.


Thanks in advance,
Sravani
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Mon Jan 23, 2012 5:23 pm    Post subject:
Reply with quote

Is your sort statement SORT USING or SORT INPUT PROCEDURE? In either case, the input file must be opened, read, then closed for the sort to proceed. The only question is whether your code does it, or SORT does it.

Basic question for you: if sort does not open the input file, just how can it read the records to sort?
Back to top
View user's profile Send private message
sravz chinnu

New User


Joined: 07 Dec 2011
Posts: 26
Location: India

PostPosted: Mon Jan 23, 2012 5:27 pm    Post subject:
Reply with quote

Thanks alot for your reply.
This is what my sort statement in cobol program.
SORT SORT-FILE
ON ASCENDING KEY S-NAME S-SURNAME
ON DESCENDING S-EMP-DATE
USING UNSORTED-PERSON
GIVING SORTED-PERSON.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Jan 23, 2012 5:33 pm    Post subject: Reply to: Internal sort not able to execute
Reply with quote

You got a file error, you have no error handling. Find out what a status 90 might be, look for error messages in your job output.
Back to top
View user's profile Send private message
sravz chinnu

New User


Joined: 07 Dec 2011
Posts: 26
Location: India

PostPosted: Mon Jan 23, 2012 5:40 pm    Post subject:
Reply with quote

Robert,
Do we really need to open input file when we use SORT USING and Giving. As i never see open statement to this. Instead i saw open stament in sort using input procedure . Please correct me if i am wrong as i am fresher.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Mon Jan 23, 2012 5:49 pm    Post subject:
Reply with quote

SORT does the open -- your program does not -- when SORT USING is invoked. Similarly, SORT does the open of the output file when SORT GIVING is invoked. The mere fact that your code does not open the file does NOT mean the file is not opened. In order for SORT to process each record, that record must be read from the file on disk (or tape) into memory -- either by SORT or by your code.

A file status 90, however, I would expect to mean that your code is doing an explicit OPEN statement that is failing. You need to learn how to use file status codes (both the usual 2-byte code as well as the extended file status codes available for VSAM files) and include them in every program you write.
Back to top
View user's profile Send private message
Jose Mateo

Active User


Joined: 29 Oct 2010
Posts: 110
Location: Puerto Rico

PostPosted: Mon Jan 23, 2012 8:04 pm    Post subject:
Reply with quote

Good day!

Check your log messages for clues to your problem, missing DD statement for the input or output. Verify your SD's in the program and like Robert mention you do need to open your sort files.
Back to top
View user's profile Send private message
sravz chinnu

New User


Joined: 07 Dec 2011
Posts: 26
Location: India

PostPosted: Tue Jan 24, 2012 9:25 am    Post subject:
Reply with quote

Thanks all.
I did not give any open statement in my program. still it is working and i got the final output which is sorted file.

Thanks,
Sravani icon_smile.gif
Back to top
View user's profile Send private message
Dexter Morgan

New User


Joined: 11 Jan 2012
Posts: 3
Location: United States

PostPosted: Tue Jan 24, 2012 7:35 pm    Post subject:
Reply with quote

Just to clarify:

Enterprise COBOL for z/OS Language Reference
Version 4 Release 2
SC23-8528-01

SORT USING
All input files must be described in FD entries in the data division.
At the time the SORT statement is executed, these files must not be open.
The compiler opens, reads, makes records available, and closes these files automatically. (From manual)

SORT GIVING
All output files must be described in FD entries in the data division.
At the time the SORT statement is executed, these files must not be open.
The compiler opens, writes, and closes these files automatically.
(SORT GIVING shortened and paraphrased from manual)

Your choice of USING/GIVING option may not be a good way of using internal SORT because you can just code SORT
JCL before your program on the input side or after creating file to sort on output side.
Back to top
View user's profile Send private message
sravz chinnu

New User


Joined: 07 Dec 2011
Posts: 26
Location: India

PostPosted: Tue Jan 24, 2012 8:39 pm    Post subject:
Reply with quote

Thanks alot MORGAN. I got clarification on this.

Sravani icon_biggrin.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us