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
 

 

Dynamic File Allocation in Easytrieve

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
View previous topic :: :: View next topic  
Author Message
satish.ms10

Active User


Joined: 10 Aug 2009
Posts: 158
Location: India

PostPosted: Tue Apr 03, 2012 6:53 pm    Post subject: Dynamic File Allocation in Easytrieve
Reply with quote

Hi All,

I am trying to allocate file dynamically using below easytrieve code:

Code:
  FILE INFILE FB (80 0)                     
  IN-REC         001  080  A               
  IN-REC1        001  040  A               
*                                           
  FILE OTFILE  FB (80 0)                   
  OT-REC         001  080  A               
  OT-REC32       001  040  A               
*                                           
 PGM  W  08 A VALUE 'BPXWDYN'               
 FS   W  02 A                               
 FN   W  16 A                               
 WS-ALLOC-STRING  W  100 A                 
 WS-A      WS-ALLOC-STRING    1 A OCCURS 100
*                                           
JOB INPUT INFILE                                             
*                                                             
   MOVE 'HLQ1.HLQ2.DYN' TO FN                               
   WS-ALLOC-STRING = 'ALLOC DD(OTFILE) DSN('''                 
   MOVE FN TO WS-A(23) 16                                     
   MOVE ''') NEW CATALOG LRECL(80) RECFM(F,B)' TO WS-A(39) 35 
   DISPLAY WS-ALLOC-STRING                                     
   CALL BPXWDYN USING WS-ALLOC-STRING                         
   OT-REC32 = IN-REC1                                         
   DISPLAY OT-REC32                                           
   PUT OTFILE                                                 
   STOP                                                       


When I execute the above program I am getting following error

Code:

19 *******A001 FILE OPEN ERROR - OTFILE                     
   *******A014 PREMATURE TERMINATION DUE TO PREVIOUS ERROR(S)


Can anyone help in this regard.

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

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Tue Apr 03, 2012 7:03 pm    Post subject: Reply to: Dynamic File Allocation in Easytrieve
Reply with quote

I guess what you are trying to do doesn't work as you have it.

Should it work in theory? I don't know. Have you checked the value of the string you are building and that everything is OK there?

What are you trying to do?

Have you considered using a FILE EXIT? This would allow you to have a (say, Cobol) program which controls the processing of that file, with Easytrieve calling that program with the data. Then, if you have something which "works" in, say, Cobol, then'll it'll work (likely) in that program.

Since you've had a go at reference-modification in Easytrieve, I'm sure you can find the file exit references in the manual.
Back to top
View user's profile Send private message
satish.ms10

Active User


Joined: 10 Aug 2009
Posts: 158
Location: India

PostPosted: Tue Apr 03, 2012 7:11 pm    Post subject:
Reply with quote

Hi Bill,

Thanks for your quick reply.

File got created when I commented below lines,

Code:
   OT-REC32 = IN-REC1                                         
   DISPLAY OT-REC32                                           
   PUT OTFILE   


But I am not able to write to the file after allocating.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Tue Apr 03, 2012 7:30 pm    Post subject: Reply to: Dynamic File Allocation in Easytrieve
Reply with quote

OK. As I said, I don't know if what you are trying to do will work. Not too big a chance that anyone here has done it (asking for trouble).

Two choices then.

  • Call CA support and ask if it should work/see if they have an Easytrieve forum where you can ask
  • Look at the File EXIT
  • There are always three things
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Apr 03, 2012 11:03 pm    Post subject:
Reply with quote

Hello,

Why not simply allocate the output file in the jcl?

If you need the dataset name to be resolved at runtime, use a symbolic parameter in the jcl.

Possibly i misunderstand. . .
Back to top
View user's profile Send private message
satish.ms10

Active User


Joined: 10 Aug 2009
Posts: 158
Location: India

PostPosted: Wed Apr 04, 2012 12:52 pm    Post subject:
Reply with quote

Hi Dick,

My requirement is I need to process a sorted file on 1 to 7 positions.

I need to update some of the data from 150 position. After that I need write the record to output file. Once I encounter a new value on 1 to 7 positions I need create new output file.

Simply, I need to create multiple output files by grouping the data on 1 to 7 positions from the input file.

Can anyone suggest me? I am looking into Bill's suggestion.

Thanks!
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


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

PostPosted: Wed Apr 04, 2012 1:08 pm    Post subject:
Reply with quote

Try this :

FILE OTFILE
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Wed Apr 04, 2012 1:12 pm    Post subject: Reply to: Dynamic File Allocation in Easytrieve
Reply with quote

Are the file names entirely "dynamic" or is there some reasonable sub-set of infinity for them?

For instance, if there is a maximum of, say, 20, you could code it out in the program and JCL, either in Easytrieve or your sort product.

However, if one day there are four, and the next there might be 1,000, that's a different thing.
Back to top
View user's profile Send private message
satish.ms10

Active User


Joined: 10 Aug 2009
Posts: 158
Location: India

PostPosted: Wed Apr 04, 2012 3:45 pm    Post subject:
Reply with quote

Hi Bill,

File names are entirely dynamic.

Since no control on the input data I am left with no option.

Thanks,
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Apr 04, 2012 8:52 pm    Post subject:
Reply with quote

Hello,

If this is needed quickly, you might consider using COBOL.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Wed Apr 04, 2012 10:50 pm    Post subject: Reply to: Dynamic File Allocation in Easytrieve
Reply with quote

I thought I'd posted this.

A File Exit, in Cobol, in really simple to do. You do all the IO, in your case ncluding multiple closes and dynamic assignments and opens, plus the writing to whatever happens to be the current file., Easytrieve calls your program whien it wants to do IO and doesn't have to know anything about the "complexity".
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 -> CA Products All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 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 CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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