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

How to access multi volume using setenv option


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
SayantaniKundu

New User


Joined: 24 Nov 2008
Posts: 6
Location: Kolkata

PostPosted: Tue May 04, 2010 11:13 am
Reply with quote

Currently in my code I am dynamically allocating file within the program using SETENV

Code:
STRING 'DSN(' DSN-NAME(1:DSN-LENGTH)'),'             
       'NEW,CYL,SPACE(100,100),UNIT(SYSDA)'         
       Z',CATALOG' DELIMITED BY SIZE                 
INTO ENV-VALUE.                                     
                                                     
MOVE 1 TO ENV-OVERWRITE.                             
CALL "SETENV" USING BY CONTENT ENV-NAME,             
      BY CONTENT ENV-VALUE,                         
      BY CONTENT ENV-OVERWRITE.                     

If I specify the dataset in a JCL I can access multi volume by specifying UNIT=(SYSDA,10)

Code:
ASBO03FL DD  DSN=AAA.TEST.DATASET, 
             DISP=(NEW,CATLG,DELETE),                             
             SPACE=(CYL,(100,100),RLSE),                           
             DCB=(RECFM=FB,LRECL=80,BLKSIZE=0),                   
             UNIT=(SYSDA,10)                                       


I am not able to give UNIT(SYSDA,10) in 'SETENV' to access multi volumes.

Can anyone please provide a solution?
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue May 04, 2010 3:29 pm
Reply with quote

The TSO ALLOCATE command has both the UNIT and count (UCOUNT) parameters. Maybe you could use the TSO ALLOCATE routines instead (see examples in this forum).
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue May 04, 2010 5:03 pm
Reply with quote

SETENV is not as flexible as BPXWDYN. BPXWDYN allows the allocate statement to include MAXVOL(??) which is the count of volumes for a multi-volume data set.
Back to top
View user's profile Send private message
SayantaniKundu

New User


Joined: 24 Nov 2008
Posts: 6
Location: Kolkata

PostPosted: Tue May 04, 2010 6:09 pm
Reply with quote

I need to use SETENV only as per the coding standard.Please suggest the way to access multi volume using setenv option.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue May 04, 2010 6:31 pm
Reply with quote

As far as I am aware, you cannot accomplish your goal. SETENV was designed to set environmental variables for use by Unix System Services programs, not for general allocation of MVS files.

You can pre-allocate the file on multiple volumes and use SETENV with disposition of OLD, or you can use BPXWDYN, or you can go back to whoever gave you the assignment and tell them it cannot be accomplished as specified.
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts How to access web services/website? Mainframe Interview Questions 4
No new posts SCOPE PENDING option -check data DB2 2
No new posts OUTFIL with SAVE option DFSORT/ICETOOL 7
No new posts CICS vs LE: STORAGE option CICS 0
Search our Forums:

Back to Top