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
 
Question about dataset sequence number on a tape volume
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 45

PostPosted: Tue May 29, 2018 9:31 am    Post subject: Question about dataset sequence number on a tape volume
Reply with quote

What will happen if do not specify a dataset sequence number while copying a dataset to tape ? Is there any advantage in specifying it ?
Why should anyone care if the dataset gets written as the 1st dataset in a volume or 65536th as long as he/she is able to retrieve it later on ?
I apologize for my stupidity

https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.3.0/com.ibm.zos.v2r3.idad400/fsn1.htm
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8704
Location: Back in jolly old England

PostPosted: Tue May 29, 2018 11:50 am    Post subject:
Reply with quote

What happened when you tried this for yourself ?
Back to top
View user's profile Send private message
Willy Jensen

Active User


Joined: 01 Sep 2015
Posts: 219
Location: Denmark

PostPosted: Tue May 29, 2018 1:37 pm    Post subject:
Reply with quote

Q: What will happen if do not specify a dataset sequence number while copying a dataset to tape ?
A: The default is 1.

Q: Is there any advantage in specifying it ?
A: Not if it is the first. Obviously you need to specify the number if not first.

Q: Why should anyone care if the dataset gets written as the 1st dataset in a volume or 65536th as long as he/she is able to retrieve it later on ?
A: You wouldn't. But of course there has to be a good reason for writeing multiple datasets to a tape. And if the datasets end up spanning tapes, then it gets complicated.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2058
Location: UK

PostPosted: Tue May 29, 2018 1:39 pm    Post subject: Reply to: Question about dataset sequence number on a tape volume
Reply with quote

If you try and write your data set as data set 1 the guy who has data currently as data set 1 will not be very happy. And nor will you be when you are booted out.
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 657
Location: The Universe

PostPosted: Tue May 29, 2018 1:40 pm    Post subject:
Reply with quote

Now there are a few things you have to watch out for.

  1. Advantages? Yes. Potentially. Many times you have tape volumes with just a few records on the tape. By writing many data sets onto a tape, you can use the tape resource more efficiently. Now that most shops use virtual tape you just have a bunch of pseudo tape volumes and it's not so critical any more.
  2. Why should you care? That's actually rather complex. Obviously if you want to open data set 50 it will take longer than if you want to open data set 1. Or if you need to use data set 30 and data set 50 at the same time it ain't gonna work! You can only open one data set at a time on one tape volume.
  3. Knowledge about the data set sequence number. If you catalog the data set, the data set sequence number is stored in the catalog entry. Systems that create multiple data sets on a tape volume such as, for example, DFSMS, keep the data set sequence number in its private catalog. If you have to know the sequence number manually, you may be cruisin' for a bruisin'.
  4. Don't specify the sequence number? It uses sequence number 1, unless you're retrieving a cataloged data set, when it uses the sequence number in the catalog.
  5. Miscellaneous. Unless you set up your JCL and program very carefully, you will have performance issues. Data management frequently rewinds a tape volume when you close a data set, or even worse, rewinds and unloads the tape volume so the operator has to remount the volume if you're going to write another data set. If you're writing one data set at a time this is a reasonable thing to do, but not if you're writing several data sets to the volume. There are things you can do in your program and JCL to persuade the system to keep the volume online, but they're not a "natural" thing to do. Another issue if you are stacking the data sets over multiple steps, you will find the system will unload a volume so the drive can be assigned to another job. There is nothing you can do in JCL to require the system to keep the volume on the drive until end of job, ...
One final comment. In the 1980s I worked for a shop that had a local modification to make stacking data sets on tape rather easy. In 1990 they were rolling out these changes, and we discovered no one actually used this facility!
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8704
Location: Back in jolly old England

PostPosted: Tue May 29, 2018 4:47 pm    Post subject:
Reply with quote

After further consideration, with the advent of virtual tape why would you want to use labels.

The last site that I worked banned the use of multi label tapes once the VTS was installed. Using "Virtual" you can increase the number of drives available to allow concurrent writing, or use UNIT=AFF= if for some reason your site doesn't wish to increase the number of virtual drives available.

Again with virtual technology you have the opportunity to greatly expand the number of logical tape volumes available to use without the need for anywhere near so many physical volumes.
Back to top
View user's profile Send private message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 45

PostPosted: Tue May 29, 2018 9:49 pm    Post subject: Reply to: Question about dataset sequence number on a tape volume
Reply with quote

Thank you all for your responses !
I think I understand this better now.
Does anyone have an example of using SEQUENCE(sequence number) along with BPXWDYN ?
I tried different ways. But when I run it I always get result = -32
Code:
call bpxwdyn("alloc da('"sysut2"') fi(sysut2)",                     
             " new catalog close mount gdgnt msg(wtp) unit(auto)", 
             " label(SL)",                                         
             " sequence(0001)",                                     
             " dataclas(tapeonly)")                                 


https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.bpxb600/rda.htm
SEQUENCE(sequence number) Specifies the relative position (number) of a data set on a tape volume.
Code:
Back to top
View user's profile Send private message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 45

PostPosted: Tue May 29, 2018 9:50 pm    Post subject:
Reply with quote

when i remove the sequence parameter, the allocation works file
Back to top
View user's profile Send private message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 45

PostPosted: Tue May 29, 2018 10:54 pm    Post subject:
Reply with quote

i think keyword: POSITION works instead of SEQUENCE
Back to top
View user's profile Send private message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 45

PostPosted: Wed May 30, 2018 1:50 am    Post subject:
Reply with quote

Does anyone know if it is possible to 'stack' datasets to a tape volume using BPXWDYN ? I have been struggling with different keywords all day to try and make this work.
I could not find a way to get the Volume Serial number of the tape volume that the first dataset in a list is written to, so I can write the remaining datasets to the same volume, incrementing the dataset sequence number
I read that RTVOL(variable) is supposed to return the volume
But it did not, for me.
Is there any alternate way to do something similar to VOLUME=(,REF=*.STEPNAME) in BPXWDYN or some other dynamic allocation program, from a rexx ?
Back to top
View user's profile Send private message
enrico-sorichetti

Senior Member


Joined: 14 Mar 2007
Posts: 10492
Location: italy

PostPosted: Wed May 30, 2018 2:29 am    Post subject: Reply to: Question about dataset sequence number on a tape volume
Reply with quote

what happened when You looked at the manuals ?
for example at https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.bpxb600/rda.htm

where it is explain also how to decode the return code
Back to top
View user's profile Send private message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 45

PostPosted: Wed May 30, 2018 3:26 am    Post subject:
Reply with quote

As i said, i have already checked the exact same manual that you pasted above.
I already tried all the options there.
Back to top
View user's profile Send private message
Willy Jensen

Active User


Joined: 01 Sep 2015
Posts: 219
Location: Denmark

PostPosted: Wed May 30, 2018 1:01 pm    Post subject:
Reply with quote

My guess is that the tape is only mounted when an OPEN is done, not at allocation time. So either do BPXWDYN INFO after the tape has been opened, or do a catalog lookup after the tape is closed.
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 657
Location: The Universe

PostPosted: Wed May 30, 2018 7:49 pm    Post subject:
Reply with quote

harisukumaran wrote:
Does anyone know if it is possible to 'stack' datasets to a tape volume using BPXWDYN ? I have been struggling with different keywords all day to try and make this work.

Technically, yes. It's not desirable: You have to free the allocation if there is one (which unloads the tape) and reallocate the tape (another mount). You lose most of the advantages of stacking data sets.

Pros, writing in Assembler language, use a different technique. They use dynamic allocation to get the tape up, use CLOSE (dcb,LEAVE) to ensure CLOSE does not rewind the tape, and fiddle with the JFCB to write additional data sets.
harisukumaran wrote:

I could not find a way to get the Volume Serial number of the tape volume that the first dataset in a list is written to, so I can write the remaining datasets to the same volume, incrementing the dataset sequence number
I read that RTVOL(variable) is supposed to return the volume
But it did not, for me.

Assuming each file is cataloged, you get the volume list of the last data set after its allocation has been freed, and use the last volume in the volume list. I suspect this will be rather difficult in Rexx.

Do not forget I'm primarily an Assembler programmer; I have never used BPXWDYN. I do use MVS dynamic allocation, but it still surprises me from time to time.

POSITION / SEQUENCE. The TSO ALLOCATE command uses POSITION. Many times it seems BPXWDYN follows the TSO ALLOCATE command.

I suggest you read and understand every word in this paragraph. RTVOL - if it is documented. If it does not seem to work, then your best bet is to open a PMR with IBM. If nothing else they'll tell you what you are doing wrong. You realize it will only return the first volume, and not even that when you allocate the first data set on a volume without a volume serial. The volume is not actually known until the data set is actually opened.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


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

PostPosted: Thu May 31, 2018 7:02 am    Post subject:
Reply with quote

Code:

//SYSUT01  DD  DSN=SAW162.JCLCHECK.DUMP0C4.JES2,DISP=(,KEEP),           
//             UNIT=TAPE,LABEL=(1,RETPD=999)   
//SYSUT02  DD  DSN=SAW162.JCLCHECK.DUMP0C4.SYSPRINT,DISP=(,KEEP),       
//             UNIT=TAPE,LABEL=(2,RETPD=999),                           
//             VOL=(,RETAIN,REF=*.SYSUT01)                             
//SYSUT03  DD  DSN=SAW162.JCLCHECK.DUMP0C4.SYSUDUMP,DISP=(,KEEP),       
//             UNIT=TAPE,LABEL=(3,RETPD=999),                           
//             VOL=(,RETAIN,REF=*.SYSUT02)                             


As can be seen dataset sequencing is achieved by the LABEL parameter,
unloading and remounting is prevented by the RETAIN parameter.
Fooling around with the JFCB is only required when the sequence number will be above 4 decimal digits.
Anyone here that wants to write to tape more than 9999 datasets?
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 657
Location: The Universe

PostPosted: Thu May 31, 2018 8:51 am    Post subject:
Reply with quote

Mr. Holland: the topic starter wants to use BPXWDYN exclusively. You're using JCL exclusively.

I suspect you want to catalog the data sets, not just keep them.

UNIT=TAPE on SYSUT02 and SYSUT03 is probably redundant as it is implied by the VOL=REF to a DD in the same step. I think I'm right about that, but it has been a decade or more since I dealt with any sort of tape.

When I talked about fiddling with the JFCB, I meant to update JFCBFLSQ (the file sequence number) and JFCBDSNM (the data set name).
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8704
Location: Back in jolly old England

PostPosted: Thu May 31, 2018 11:28 am    Post subject:
Reply with quote

As a matter of interest, I'd like to know the reason for wanting to use multi label tape volumes.

The only scenario I can think of is when data is sent to another site.

As I have said above, the use of VTS is sooooooo good, as I found out when I was a storage administrator, back in the good old days of being allowed to work on the z/OS beastie

36_2_18.gif
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


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

PostPosted: Thu May 31, 2018 11:35 am    Post subject:
Reply with quote

The topic starter has to find out if the parameters can be used with bpxwdyn.

That was the approach of my comment.

The topic starter is absolutely not interested in JFCB handling as far as I can see.

Quote:
UNIT=TAPE on SYSUT02 and SYSUT03 is probably redundant as it is implied by the VOL=REF to a DD in the same step. I think I'm right about that, but it has been a decade or more since I dealt with any sort of tape.


I wouldn't know (just like you). It worked , as was the aim.
Back to top
View user's profile Send private message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 45

PostPosted: Thu May 31, 2018 4:22 pm    Post subject:
Reply with quote

The reason I wanted to use dynamic allocation (not necessarily BPXWDYN) was because my requirement is to back up new generations of over a thousand GDGs on a nightly basis. If any of the backups fail, i do not want to abend the job but move on and backup the next new GDG. There may be multiple generations of any GDG on any given day. I update last succefully backed up g0000v00 for each gdg in a control file so I can start the backup from the next generation the next day.
If there is no way this can be done via dynamic allocation i have no option but to generate backup jcl dynamically every time and submit it and somehow keep track of the last backed up generation.
Back to top
View user's profile Send private message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 45

PostPosted: Thu May 31, 2018 4:59 pm    Post subject:
Reply with quote

I was told that automated backups would require the dataset names to follow a pattern. Datasetsl names in my list do not have any naming pattern and so I need to develop this custom process. Also, my tape management person tells me that tapes backed up for extended periods of time need to be stacked with datasets.
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 -> JCL & VSAM All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DFSMShsm dump tape migration to new t... pietras65 IBM Tools 0 Mon Aug 13, 2018 8:43 pm
No new posts Add Comma to each record until find t... naveensrimf DFSORT/ICETOOL 6 Sat Jul 28, 2018 12:25 am
No new posts FILE versus DATASET jerryte All Other Mainframe Topics 9 Fri Jun 29, 2018 10:47 pm
No new posts Temp dataset unusual behavior sheersh JCL & VSAM 5 Tue May 08, 2018 9:52 pm
No new posts INVALID RECFM FOR DDNAME SYSLIN AND C... sandeep kumar302 All Other Mainframe Topics 7 Fri Apr 27, 2018 6:07 pm

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