gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[open-cobol-list] use environment-variable for filename


From: picard
Subject: [open-cobol-list] use environment-variable for filename
Date: Mon Aug 15 04:54:04 2005

Hello list,

Allthough I browsed thru previous postings I could not find any reference to my 
(very) simple question: how do I access (unix)-files in a Cobol-programm ?

I'm currently working on a mainframe-to-Linux conversion which also includes 
about 20 cobol-programms. For this I installed Opencobol on Linux and Z/Linux.

When I run a mainframe-program that only opens a file I get error: libcob: 
Permanent file error (STATUS=30)

      **************************************************                
       ENVIRONMENT DIVISION.                                            
      **************************************************                
       INPUT-OUTPUT SECTION.                                            
       FILE-CONTROL.                                                    
           SELECT F001 ASSIGN TO WF001.                             
                                                                       
      **************************************************                
       DATA DIVISION.                                                   
      **************************************************                
       FILE SECTION.                                                    
                                                                        
       FD  F001                                                         
           RECORDING MODE IS V                                          
           LABEL RECORDS OMITTED.                                       
       01  F001REC    PIC X(121).
bla bla bla
       INIT SECTION.                                                    
       I-01.                                                            
           DISPLAY 'START PROGRAMMA P080DGDG'.                          
           OPEN OUTPUT F001.                                            .       
                                  
bla bla bla                                                        
               
When I change to
       INPUT-OUTPUT SECTION.                                            
       FILE-CONTROL.                                                    
           SELECT F001 ASSIGN TO '/tmp/F001'.                             
 A file  'F001' is created on '/tmp'

Is it possible to use an environment-variable for filename insteed of a fixed 
filename ?

TIA, 
    Leon Dings
    DBA

reply via email to

[Prev in Thread] Current Thread [Next in Thread]