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 

Compile time error in File Section

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Thu Sep 08, 2005 9:25 am    Post subject: Compile time error in File Section Reply with quote

Basically i am trying to generate a output file which has a header , detail rec and a trailer.At the run time i will be assiging values to both Header rec & trailer rec that is why i have opened both of them in OUTPUT MODE in PROCEDURE DIVISION.In my program i want to print first the header , then the detail record and then the trailer.I am coding in my program like this .But when i try to compile my program i am getting compile time error saying:

A non-level-88 "VALUE" clause was found in the "FILE SECTION" or "LINKAGE SECTION". The "VALUE" clause was
treated as comments.

SAME MESSAGE ON LINE NO:



Can we not assign values / initialize to elementary items in a record structure of a File in File section ? Can anybody help me out why i am getting compile time error ?

Morever i have two very big messages which needs to be declared at level 88 but the messages are too long.How can i define them as the message is more than 133 bytes in length.
Code:


FILE-CONTROL.

SELECT HEADER-FILE   ASSIGN TO HEADER     
       FILE STATUS IS HEADER-FILE-STATUS. 
                                           
SELECT TRAILER-FILE  ASSIGN TO TRAILER     
       FILE STATUS IS TRAILER-FILE-STATUS.


SELECT OUTPUT-FILE   ASSIGN TO OUTFILE     
       FILE STATUS IS OUTPUT-FILE-STATUS.


DATA DIVISION.
FILE SECTION.

FD  HEADER-FILE                                         
    LABEL RECORDS ARE STANDARD                           
    RECORDING MODE IS F                                 
    BLOCK CONTAINS 0 CHARACTERS                         
    DATA RECORD  IS OUTPUT-HDR-REC.                     
                                                         
01 OUTPUT-HDR-REC.                                       
   05 OUT-HDR-EMPNO         PIC X(04) VALUE 'EMPNO'.     
   05 OUT-HDR-NAME          PIC X(04) VALUE 'NAME'.                   
   05 OUT-HDR-AGE           PIC X(03) VALUE 'AGE'.     
   05 OUT-HDR-DATE          PIC X(08).
   05 OUT-HDR-TIME          PIC X(08).           
   05 FILLER                PIC X(53) VALUE SPACES.                   



FD  TRAILER-FILE                                   
    LABEL RECORDS ARE STANDARD                     
    RECORDING MODE IS F                           
    BLOCK CONTAINS 0 CHARACTERS                   
    DATA RECORD  IS OUTPUT-TRL-REC.               
                                                   
01 OUTPUT-TRL-REC.                                 
   05 OUT-TRL-GOOD          PIC X(04)  VALUE 'GOOD'.
   05 OUT-TRL-BYE           PIC X(03)  VALUE 'BYE'.             
   05 OUT-TRL-EMPLOYEES     PIC X(09)  VALUE 'EMPLOYEES'.         
   05 OUT-HDR-DATE          PIC X(08).
   05 OUT-HDR-TIME          PIC X(08).
   05 FILLER                PIC X(48)  VALUE SPACES.             

FD  OUTPUT-FILE                                   
    LABEL RECORDS ARE STANDARD                     
    RECORDING MODE IS F                           
    BLOCK CONTAINS 0 CHARACTERS                   
    DATA RECORD  IS OUTPUT-DETAIL-REC.               
                                                   
01 OUTPUT-DETAIL-REC.                                 
   05 OUT-EMPNO             PIC X(04).
   05 OUT-EMPNAME           PIC X(04).             
   05 OUT-EMPAGE            PIC 9(03).         
   05 FILLER                PIC X(69) VALUE SPACES.             



PROCEDURE DIVISION.

OPEN OUTPUT HEADER-FILE.                                     
EVALUATE HEADER-FILE-STATUS                                 
   WHEN '00'                                                 
     CONTINUE                                               
   WHEN OTHER                                               
     DISPLAY '*********** ERROR *******************'         
     PERFORM ABEND-PARA
END-EVALUATE.                                               



OPEN OUTPUT TRAILER-FILE.                                   
EVALUATE TRAILER-FILE-STATUS                                 
   WHEN '00'                                                 
     CONTINUE                                               
   WHEN OTHER                                               
     DISPLAY '*********** ERROR *******************'         
     PERFORM ABEND-PARA       
END-EVALUATE.
Back to top
View user's profile Send private message
dtf
Beginner


Joined: 10 Dec 2004
Posts: 110
Topics: 8
Location: Colorado USA

PostPosted: Thu Sep 08, 2005 9:33 am    Post subject: Reply with quote

Quote:
Can we not assign values / initialize to elementary items in a record structure of a File in File section ? Can anybody help me out why i am getting compile time error ?


No, you cannot have a value clause. What you should do is build your output records in WORKING STORAGE, and then do a WRITE ....... FROM......
________
[URL=http://www.ford-wiki.com/wiki/Ford_Fairmont_(Australia)]Ford Fairmont (Australia)[/URL]


Last edited by dtf on Tue Feb 01, 2011 2:02 pm; edited 1 time in total
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Thu Sep 08, 2005 9:35 am    Post subject: Reply with quote

Shekar123,

That is just an information message - not an error. You code should work fine. If you get an compilation error, pls post the error message and compiler options used.

Your second question has already been answered by Kolusu and Dtf in this thread. Pls don't post the same question again and again.
http://www.mvsforums.com/helpboards/viewtopic.php?t=4748

Thanks,
Phantom
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Thu Sep 08, 2005 9:38 am    Post subject: Reply with quote

Shekar123,

Data items defined in the FILE and LINKAGE SECTIONS do not actually allocate any storage (i.e., they provide addressability to already existing storage areas), VALUE clauses other than level-88 condition-name entries may notbe specified in these sections. So you need to move your definitions to working-storage section.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Thu Sep 08, 2005 10:34 am    Post subject: Compile time error in File Section Reply with quote

Kolusu,

Thanks for the answer regarding the File Concepts initialization and i got my doubt cleared.But still i am getting a information message like "A severe error was found in the program. The "OPTIMIZE" compiler option was cancelled.Does compiler option OPTIMIZE plays a vital role in any compilation of a program and can u please brief me what could be the cause for compile option OPTIMIZE to be cancelled and what exactly do we mean by OPTIMIZE option ? I have read about the option in one of the links but i am unable to make out any understanding.


My compile options are :


Invocation parameters:
LIB,APOST,NOADV,OBJ,NOD,SQL("APOSTSQL,APOST"),VBREF,OPT,X,NODYN,MAP,NOOFF,LIST,S,BUF(12K),RENT,TERM,NOC(E),NOSEQ
Options in effect:
NOADATA
NOADV
APOST
ARITH(COMPAT)
NOAWO
BUFSIZE(12288)
NOCICS
CODEPAGE(1140)
NOCOMPILE(E)
NOCURRENCY
DATA(31)
NODATEPROC
DBCS
NODECK
NODIAGTRUNC
NODLL
.
.
.
.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Thu Sep 08, 2005 11:15 am    Post subject: Reply with quote

Quote:

can u please brief me what could be the cause for compile option OPTIMIZE to be cancelled and what exactly do we mean by OPTIMIZE option ? I have read about the option in one of the links but i am unable to make out any understanding.


Shekhar123,

Read this

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGY3PG10/2.4.37?DT=20020923143836

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kirank
Beginner


Joined: 21 Apr 2004
Posts: 61
Topics: 33
Location: hyderabad

PostPosted: Fri Sep 09, 2005 8:52 am    Post subject: Reply with quote

Hi kolusu,
i'm using mf cobol.
For the question :
Can we not assign values / initialize to elementary items in a record structure of a File in File section ? Can anybody help me out why i am getting compile time error ?

when i tried it as :

data division.
file section.
01 file-rec.
05 ename pic x(5) value "abcde".

and i opened the file and writing file-rec.
it is writing properly. it is not giving any compilation errors.
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Fri Sep 09, 2005 12:25 pm    Post subject: Reply with quote

kirank,

As I said earlier, that was just an INFORMATION message not an error.

Shekar123,

Did by any chance, your job ended in an RC >=8 ? (Assuming there are no other errors in your program).

Thanks,
Phantom
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Fri Sep 09, 2005 12:30 pm    Post subject: Reply with quote

kirank,

You only get informational messages during compilation even on the mainframe and the code will work. The return code is zero. However the output file will not have the record "abcde" . Did you check if it actually wrote the record with "abcde".

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kirank
Beginner


Joined: 21 Apr 2004
Posts: 61
Topics: 33
Location: hyderabad

PostPosted: Sat Sep 10, 2005 7:35 am    Post subject: Reply with quote

Hi kolusu,

you are correct. It is not writing record to the output file. But where as when i accept a value into the data item and writing it to the output file, it is writing properly.

Thanks for the clarification.

kirank
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 -> Application Programming 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