Appendix D. Dataset Name Determination

When issuing a put command to create a dataset, or get to a local dataset using the cozsftp client, the resulting dataset name is determined as follows:

put myfile //HLQ.LEVEL  (a remote client using the Co:Z SFTP server)
get myfile //HLQ.LEVEL  (using the cozsftp client)

Table D.1. Dataset Name determination

CaseConditionDataset NameNotes
1HLQ.LEVEL is a Sequential DatasetHLQ.LEVELReplaces existing SEQ dataset
2HLQ.LEVEL is a PDSHLQ.LEVEL(MYFILE)Creates or replaces member named MYFILE in PDS
3HLQ.LEVEL is not a dataset, but HLQ.LEVEL.XXX names exist in catalogHLQ.LEVEL.MYFILECreate or replace SEQ dataset
4HLQ.LEVEL is not a dataset, and no HLQ.LEVEL.XXX names exist in catalogHLQ.LEVELCreates new SEQ dataset

In most cases, this is acceptable behavior. However, there are cases where the supplied name should be treated as a dataset rather than a "directory" (as in Case 3 above). If this is the required behavior, a different dataset prefix can be supplied: //! or /-/!.

put myfile //!HLQ.LEVEL  (a remote client using the Co:Z SFTP server)
get myfile //!HLQ.LEVEL  (using the cozsftp client)

Note: In release 2.4.0, this was relaxed so that the '!' decorator may appear anywhere in the data set name.

Table D.2. Dataset Name determination - DSN contains "!" decorator

CaseConditionDataset NameNotes
1HLQ.LEVEL is a Sequential DatasetHLQ.LEVELReplaces existing SEQ dataset
2HLQ.LEVEL is a PDSHLQ.LEVEL(MYFILE)Creates or replaces member named MYFILE in PDS
3HLQ.LEVEL is not a datasetHLQ.LEVELCreates new SEQ dataset

D.1 maxdsndirlevels option

In release 2.4.0, the maxdsndirlevels setting was added to specify the maximum number of levels that a data set name can have before it is always considered as a new file rather than a (pseudo) directory.

For example:

(a remote client connected to Co:Z SFTP server)
sftp> ls -alf //kirk.dsn.test
Volume   Referred  Ext  Tracks    Used Recfm Lrecl BlkSz Dsorg  Dsname
VPWRKC  2013/06/06   1       1       1  U        0  6144  PS    KIRK.DSN.TEST.TST1
VPWRKB  2013/06/06   1      15       1  FB      80 27920  PS    KIRK.DSN.TEST.TXT2
sftp> put local.file //kirk.dsn.test 
Uploading local.file to //kirk.dsn.test/local.file 1   
...
sftp> put local.file //!kirk.dsn.test  2
Uploading local.file to //kirk.dsn.test
...
sftp> rm //kirk.dsn.test
sftp> ls /+maxdsndirlevels=2  3  
/+maxdsndirlevels=2
sftp> put local.file //kirk.dsn.test  4 
Uploading local.file to //kirk.dsn.test
...
sftp> rm //kirk.dsn.test
sftp> cd //kirk.dsn.test  5
Couldn't stat remote file: No such file or directory 

1

//kirk.dsn.test is treated as a "directory", since there is no data set with that name but there are data sets at lower levels. Since the sftp client sees a directory, it will create a new file name in that directory. The resulting DSN is KIRK.DSN.TEST.LOCAL.FILE

2

The use of the '!' character in the DSN will force Co:Z SFTP server to tell the client that it is a non-existant file, rather than a directory. The resulting DSN is: KIRK.DSN.TEST

3

Setting this option will mean that DSNs with more than two levels are never considered as pseudo directories.

4

The use of the '!' decorator is not required. The resulting DSN is: KIRK.DSN.TEST

5

Since this DSN has more levels than maxdsndirlevels, you can not "change directory" to it.

Recommendation: When creating new data sets where it is possible that data sets exist at lower levels, use the //! or /-/! syntax or the maxdsndirlevels option.


Saint Charles, Missouri
info@coztoolkit.com
+1 636.300.0901

Copyright© 2009 - 2023 Dovetailed Technologies, LLC. All rights reserved. Co:Z® is a registered trademark and Co:Z Toolkit™ is a trademark of Dovetailed Technologies, LLC.

Saint Charles, Missouri
info@coztoolkit.com
+1 636.300.0901

Copyright© 2009 - 2023 Dovetailed Technologies, LLC. All rights reserved. Co:Z® is a registered trademark and Co:Z Toolkit™ is a trademark of Dovetailed Technologies, LLC.