FLAM Issue Tracker - FL5
View Issue Details
0001023FL52.2 Subprogram FLUC (CONV)public2021-09-15 10:462021-09-15 14:03
Lukas Trilla 
Falk Reichbott 
normalmajoralways
resolvedfixed 
System Zz/OSV2R30
5.1.25 
 
0001023: zip archive of zOS USS directory doesn't contain subdirectories
Hello Colleagues,

I would like to pack content of zOS USS file system directory including it's subdirectories into a zip archive using FLUC and store it in GDG generation data set under zOS file system for further processing.
The directory I want to pack includes 18 files + 1 subdirectory including around 30 other files. However I am always getting only those 18 files from the parent directory in my output archive and the subdirectory with it's content is missing.
These are the parameters from my JCL:

READ.CHAR(
FILE='/dbs/sftp/ft/*'
)
WRITE.BIN(
   FILE='DD:OUT1'
    ARCHIVE.ZIP()
)

I went through the FLCL manual and I have tried many other wildcard variations in the 'FILE' path line, but none of them worked. The only way it worked, when I added another line like below - Then I had all the structure and and all the files in my archive.
I kind of don't like this solution, I believe simple '/dbs/sftp/ft/*' or similar string should be enough. Hardcoding sub directories can be trouble in future as the structure of the folders can change.

READ.CHAR(
FILE='/dbs/sftp/ft/*'
FILE='/dbs/sftp/ft/old_scripts/*'
)
WRITE.BIN(
   FILE='DD:OUT1'
    ARCHIVE.ZIP()
)

Could you please advise on this? Perhaps there is a bug in the program, perhaps I am doing something wrong... I am not able to figure it out though.
Many thanks for every advice and have a good day!

Lukas
No tags attached.
Issue History
2021-09-15 10:46Lukas TrillaNew Issue
2021-09-15 11:09Falk ReichbottAssigned To => Falk Reichbott
2021-09-15 11:09Falk ReichbottStatusnew => assigned
2021-09-15 11:22Falk ReichbottNote Added: 0001346
2021-09-15 13:53Lukas TrillaNote Added: 0001347
2021-09-15 14:03Falk ReichbottStatusassigned => resolved
2021-09-15 14:03Falk ReichbottResolutionopen => fixed

Notes
(0001346)
Falk Reichbott   
2021-09-15 11:22   
To include sub directories the DIR object must be defined with recursive.

READ.CHAR(
FILE='/dbs/sftp/ft/*'
)
WRITE.BIN(
   FILE='DD:OUT1'
    ARCHIVE.ZIP(#STREAM#)
)
DIR(RECURSIVE)

If the GDG a PSVB this could result in performance issues because RBA access (byte seek) is required to write standard ZIP files. To prevent this you can request the streamed format, but then you must check if the streamed format supported by the other parties. I have set the corresponding parameter in comment above.

read.char with write.bin is a strange solution, to convert from 1047 to UTF-8. Better you work with read.char(ccsid=1047) write.char(ccsid=utf-8). Normally the files are XML in you case, then it would be better to work with.

READ.TEXT(
FILE='/dbs/sftp/ft/*'
CCSID=1047
)
WRITE.TEXT(
FILE='DD:OUT1'
CCSID=UTF-8
METHOD=LF#UNIX#
ARCHIVE.ZIP(#STREAM#)
)
DIR(RECURSIVE)

With read.xml() write.xml() you can check if anything correct XML and can change the look and feel to be human readable (PRETTYPRINT) or for computer (MINIMIZED) if you want.
(0001347)
Lukas Trilla   
2021-09-15 13:53   
DIR(RECURSIVE) in combination with ARCHIVE.ZIP(#STREAM#) worked perfect! Many thanks for your prompt reaction!