IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Allocate a tape file inside a PL/I program using BPXWDYN


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Thu Mar 03, 2011 11:15 pm
Reply with quote

I am lost in dynamic allocation of a tape file inside a PL/I program.

I am using either BPXWDYN or DYNALLOC and none was successfully processed.

Something like this should be OK and enough.

Code:
ALLOC_STR = ' ALLOC FI(ALPHA) DA(my.tape.file) SHR REUSE'
CALL BPXWDYN(ALLOC_STR)

But failed with code error 356 via SHORTRC. ( normal error code something like 327546432 )
I added UNIT(TAPE). Reran. No way

When I give the information in the JCL, just like this :
Code:
//ALPHA  DD DISP=SHR,DSN=my.tape.file 

: it is working.

I went through the whole set of attributes of BPXWDYN but nothing helped me.

Question : is such allocation of tape file possible inside a PL/I program? Bug or not? APAR?

Thanks

Pierre
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Fri Mar 04, 2011 12:51 am
Reply with quote

Have you already tried dynamic allocation using the TITLE option as per Chapter 8 of the PL/I Programming Guide?
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Fri Mar 04, 2011 12:54 am
Reply with quote

Not yet used.
To read this evening and to try tomorrow.

Thanks

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

Global Moderator


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

PostPosted: Fri Mar 04, 2011 12:11 pm
Reply with quote

You could try the following :

Code:

DCL PLIRETV BUILTIN;
  DCL BPXWDYN EXTERNAL ENTRY OPTIONS(ASM INTER RETCODE);
  DCL ALLOC_STR CHAR(100) VAR
        INIT('ALLOC FI(SYSIN) DA(MY.DATASET) SHR');
  FETCH BPXWDYN;
  CALL BPXWDYN(ALLOC_STR);
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Fri Mar 04, 2011 1:53 pm
Reply with quote

PeterHolland wrote:
You could try the following :

Code:

DCL PLIRETV BUILTIN;
  DCL BPXWDYN EXTERNAL ENTRY OPTIONS(ASM INTER RETCODE);
  DCL ALLOC_STR CHAR(100) VAR
        INIT('ALLOC FI(SYSIN) DA(MY.DATASET) SHR');
  FETCH BPXWDYN;
  CALL BPXWDYN(ALLOC_STR);


And how does this differ from what the OP posted?
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


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

PostPosted: Fri Mar 04, 2011 2:20 pm
Reply with quote

prino wrote:
PeterHolland wrote:
You could try the following :

Code:

DCL PLIRETV BUILTIN;
  DCL BPXWDYN EXTERNAL ENTRY OPTIONS(ASM INTER RETCODE);
  DCL ALLOC_STR CHAR(100) VAR
        INIT('ALLOC FI(SYSIN) DA(MY.DATASET) SHR');
  FETCH BPXWDYN;
  CALL BPXWDYN(ALLOC_STR);


And how does this differ from what the OP posted?


At least 4 statements. And to me that is a difference.
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Sat Mar 05, 2011 3:44 am
Reply with quote

I abandonned BPXWDYN ( maybe when I find time I will make a set of tests.
Now I am using a version of DYNALOC program ( ASM with call to SVC99 ) : after several tries, I reach the correct parameter list to provide :

fields of ALLOC01

REQUEST = 'ALLOC'
DDNAME = 'ALPHA'
DSN ='my.tape.file'
STATUS = 'SHR'
NDISP = 'KEEP'
CDISP = 'KEEP'
RECFM = 'FB'
UNIT = 'K'
Then CALL DYNALOC(ALLOC01);

I am not sure the version of DYNALOC I am using : from CBTTAPE, or a variation.
Anyway the main information to give looks like this.

Thanks for your time.

Nice week-end

Pierre
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Binary File format getting change whi... All Other Mainframe Topics 7
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top