View previous topic :: View next topic
|
Author |
Message |
Squeak6
New User
Joined: 04 Aug 2005 Posts: 36
|
|
|
|
I tried to search ( no luck )
Hello all..
I'm trying to create several files from one file. lets say I had a file with 100 records and I waned it to copy the first 25 to one file then the next 25 to another then the next 25 to another...( I hope you get what I'm trying to do)
how would I do that?
Squeak...
Miami,fl |
|
Back to top |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
Code: |
//STEP05 EXEC PGM=SORT
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=01,ENDREC=25
OUTFIL FILES=02,STARTREC=26,ENDREC=50
OUTFIL FILES=03,STARTREC=51,ENDREC=75
OUTFIL FILES=04,STARTREC=76
//SORTIN DD DSN=DSNIN,DISP=SHR
//SORTOF01 DD DSN=DSN1,UNIT=DISK,
// DISP=(NEW,CATLG,DELETE),SPACE=(CYL,(1,1),RLSE)
//SORTOF02 DD DSN=DSN2,UNIT=DISK,
// DISP=(NEW,CATLG,DELETE),SPACE=(CYL,(1,1),RLSE)
//SORTOF03 DD DSN=DSN3,UNIT=DISK,
// DISP=(NEW,CATLG,DELETE),SPACE=(CYL,(1,1),RLSE)
//SORTOF04 DD DSN=DSN4,UNIT=DISK,
// DISP=(NEW,CATLG,DELETE),SPACE=(CYL,(1,1),RLSE)
|
|
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Squeak,
Here's a DFSORT job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//OUT1 DD DSN=... output file1
//OUT2 DD DSN=... output file1
//OUT3 DD DSN=... output file1
//OUT4 DD DSN=... output file1
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=(OUT1,OUT2,OUT3,OUT4),SPLIT1R=25
/*
|
If you need something more dynamic, see the "Split a file to n output files dynamically" Smart DFSORT Trick at:
www.ibm.com/servers/storage/support/software/sort/mvs/tricks/ |
|
Back to top |
|
|
Squeak6
New User
Joined: 04 Aug 2005 Posts: 36
|
|
|
|
* thanks for the quick reply * ( I took a late lunch ~ sorry for delay)
i have a question... lets say I don't know the number of records in the input file..... how do I know how many output files to create? keep in mind that I want this job to run on its own.
Squeak... |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Do you want the job to dynamically determine the number of output files by dividing the count of records by 25, and then set up that number of output files and do the split to them? Or do you want something else?
What would a model output DD statement look like?
Are you allowed to have a job submit another job to the internal reader?
What is the RECFM and LRECL of the input file?
What is the approx. maximum number of input records you expect? |
|
Back to top |
|
|
Squeak6
New User
Joined: 04 Aug 2005 Posts: 36
|
|
|
|
What I really want to do is create PDF files... However ( for some reason ) the PDF mainframe app. can not create more than 1,000 pages ( when the page # = 1,000 ). So what I did as a temp fix was to have the program write to a new output file every 1,000 pages of data.
If I could find out a way to have the JCL create files of 1,000 pages of data that would be great. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
If You post more details, somebody might give more suggestions...
after Your last post ( about pdf creation ) I doubt that a split based on the record count might achieve what You need...
it would be necessary for all the pages to have exactly the same layout,
number of lines, sometimes even the same line pattern...
( a right justified 1 and a right justified 999999999999 might give different record length,
a character string with different non blank lengths might have the same problems,
and these things might give a different number of records )
I am pointing out things to meditate upon,
I do not know what software You are using to create the PDF' s ,
so I do not know the details of output sizes
I would analyze more in depth and maybe resort to some kind of dynamic
allocation of output PDF's
And again ( personal opinion ) a 1000 pages document is something not really handy to read and search... |
|
Back to top |
|
|
Squeak6
New User
Joined: 04 Aug 2005 Posts: 36
|
|
|
|
We currently have 3,000 page reports that we create on fiche ( bi-weekly )... I think moving those reports to PDF would be a better option ( i could be wrong ) |
|
Back to top |
|
|
|