Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Dynamic allocataion of file in COBOL

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

Active User


Joined: 23 Jul 2008
Posts: 106
Location: USA

PostPosted: Tue Feb 09, 2010 4:12 pm    Post subject: Dynamic allocataion of file in COBOL
Reply with quote

I am trying to create a file dynamically from a COBOL program.

But the file is not getting allocated.

Could some one help me on this.

Code:

FILE-CONTROL.
 
   SELECT TEST-FILE ASSIGN TO DD1.



Code:

DATA DIVISION.
FILE SECTION.

FD  TEST-FILE
     LABEL RECORDS ARE STANDARD
     BLOCK CONTAINS 0 RECORDS.
01  TEST-REC           PIC X(80).

WORKING-STORAGE SECTION.

01 WS-DYNAMIC-OPEN-AREA.
   05 FILE-NAME.
       10 FILLER PIC X(35)  VALUE
          'DD1=DSN(TEST.PS.TESTFILE.OUT01) SHR'.
   05 FILE-PTR POINTER.
   05 RC PIC S9(9) BINARY VALUE ZERO.



Code:

PROCEDURE DIVISION.

SET FILE-PTR TO ADDRESS OF FILE-NAME
         CALL 'PUTENV' USING BY VALUE FILE-PTR RETURNING RC
IF RC NOT = 0
   DISPLAY 'FILE PROBLEM'
END-IF
STOP RUN.


Please let me know if you need further details.
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8154
Location: East Dubuque, Illinois, USA

PostPosted: Tue Feb 09, 2010 4:19 pm    Post subject:
Reply with quote

Search this forum -- there have been several discussions of COBOL dynamic allocation of files in the last year, including complete examples of code to do dynamic allocation.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Feb 09, 2010 4:36 pm    Post subject:
Reply with quote

I always felt comfortable with BPXWDYN over PUTENV.

Though you will get examples of both if you search forum
Back to top
View user's profile Send private message
Mathiv Anan

Active User


Joined: 23 Jul 2008
Posts: 106
Location: USA

PostPosted: Tue Feb 09, 2010 5:33 pm    Post subject: Reply to: Dynamic allocataion of file in COBOL
Reply with quote

An article by ED WATSON on 'Dynamic File Allocation With COBOL' helped me to resolve the problem.

Thanks.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Feb 09, 2010 5:50 pm    Post subject: Re: Reply to: Dynamic allocataion of file in COBOL
Reply with quote

Mathiv Anan wrote:
An article by ED WATSON on 'Dynamic File Allocation With COBOL' helped me to resolve the problem
And a pointer to that article is that hard to provide?
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2441
Location: Netherlands, Amstelveen

PostPosted: Tue Feb 09, 2010 5:53 pm    Post subject: Re: Reply to: Dynamic allocataion of file in COBOL
Reply with quote

William Thompson wrote:
Mathiv Anan wrote:
An article by ED WATSON on 'Dynamic File Allocation With COBOL' helped me to resolve the problem
And a pointer to that article is that hard to provide?


It probably is.
So to make new friends i will do that :

http://www.schlabb.de/resources/04009.pdf
Back to top
View user's profile Send private message
Mathiv Anan

Active User


Joined: 23 Jul 2008
Posts: 106
Location: USA

PostPosted: Tue Feb 09, 2010 6:53 pm    Post subject: Reply to: Dynamic allocataion of file in COBOL
Reply with quote

oh no.. I am sorry.

Thanks Peter ;)
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 File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 0 Tue Sep 26, 2017 3:35 am
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 2 Tue Sep 26, 2017 3:07 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 8 Fri Sep 22, 2017 11:35 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us