View previous topic :: View next topic
|
Author |
Message |
NathanReese
New User
Joined: 18 Sep 2024 Posts: 5 Location: United States
|
|
|
|
I am looking for way to combine many flat files into single file with the dataset name name header (just like IEBPTPCH does for a library but instead for I would provide a list of file names like).
Something like:
Code: |
//IEBPTPCH EXEC PGM=IEBPTPCH
//SYSUT2 DD DISP=(,CATLG,DELETE),UNIT=SYSDA,
// SPACE=(CYL,(900,55)),DSN=COMB.FLAT.FILE,
// DCB=(RECFM=FB,LRECL=95,BLKSIZE=0)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
PUNCH TYPORG=PO
DSN=FB94.RAW.D1022.T1230
DSN=FB94.RAW.D1022.T1252
DSN=FB94.RAW.D1022.T1302
DSN=FB94.RAW.D1022.T1303 |
Would produce file looking like:
Code: |
DSN: FB94.RAW.D1022.T1230
.... <file content>
DSN: FB94.RAW.D1022.T1252
.... <file content>
DSN: FB94.RAW.D1022.T1302
.... <file content>
DSN: FB94.RAW.D1022.T1303
.... <file content> |
This will be used to
1) speed up transfer time (download 1 big file, instead of many small files)
2) help search many small files at one |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1329 Location: Bamberg, Germany
|
|
|
|
Use an INSTREAM PROC like the shown one.
Code: |
//IEBPTPCH PROC DSN=NULLFILE
//COPY EXEC PGM=SORT,PARM='MSG=NO,JP0"&DSN"'
//SORTIN DD DISP=SHR,DSN=&DSN
//SYSOUT DD SYSOUT=*
//SORTOUT DD DSN=<big_dsn>,
// DISP=(MOD,CATLG,DELETE),UNIT=SYSALLDA,
// SPACE=(CYL,(2,1),RLSE),
// DSORG=PS,BLKSIZE=0
//SYSIN DD *
OPTION COPY
OUTFIL HEADER1=(C'DSN:',2X,JP0)
END
/*
// PEND
//*
// EXEC IEBPTPCH,DSN=FB94.RAW.D1022.T1230
// EXEC IEBPTPCH,DSN=FB94.RAW.D1022.T1252
// EXEC IEBPTPCH,DSN=FB94.RAW.D1022.T1302 |
|
|
Back to top |
|
|
NathanReese
New User
Joined: 18 Sep 2024 Posts: 5 Location: United States
|
|
|
|
Excellent - that works great!
Now only have to figure way to get around 256 step limit... (have ~1700+ dsn to combine). I think I'll just have to break this up into multiple jobs and run them sequentially. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 730 Location: Denmark
|
|
|
|
Or run them in a REXX or some such, using dynalloc for allocation of datasets. |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1049 Location: Richmond, Virginia
|
|
|
|
I am a little bothered by naming the PROC the same as the utility program.
Sure, it works, but I can see a beginner being confused. |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1329 Location: Bamberg, Germany
|
|
|
|
Phrzby Phil wrote: |
I am a little bothered by naming the PROC the same as the utility program.
Sure, it works, but I can see a beginner being confused. |
Indeed, it could be confusing for some. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 730 Location: Denmark
|
|
|
|
You can call the proc whatever you like, as long as the name is valid. You could just call it A. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
Quote: |
You can call the proc whatever you like, as long as the name is valid. You could just call it A. |
and... if you want people think that you are using Object Oriented jcl you might call it SELF |
|
Back to top |
|
|
|