View previous topic :: View next topic
|
Author |
Message |
sravz chinnu
New User
Joined: 07 Dec 2011 Posts: 26 Location: India
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
sravz chinnu
New User
Joined: 07 Dec 2011 Posts: 26 Location: India
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
sravz chinnu
New User
Joined: 07 Dec 2011 Posts: 26 Location: India
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Jose Mateo
Active User
Joined: 29 Oct 2010 Posts: 121 Location: Puerto Rico
|
|
|
|
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 |
|
|
sravz chinnu
New User
Joined: 07 Dec 2011 Posts: 26 Location: India
|
|
|
|
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 |
|
Back to top |
|
|
Dexter Morgan
New User
Joined: 11 Jan 2012 Posts: 3 Location: United States
|
|
|
|
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 |
|
|
sravz chinnu
New User
Joined: 07 Dec 2011 Posts: 26 Location: India
|
|
|
|
Thanks alot MORGAN. I got clarification on this.
Sravani |
|
Back to top |
|
|
|