IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Several files from one file...


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Squeak6

New User


Joined: 04 Aug 2005
Posts: 36

PostPosted: Mon Dec 10, 2007 10:56 pm
Reply with quote

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
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Mon Dec 10, 2007 11:06 pm
Reply with quote

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
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon Dec 10, 2007 11:07 pm
Reply with quote

Look at the topic Five ways to split a data set here

www.ibm.com/servers/storage/support/software/sort/mvs/tricks/
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Dec 10, 2007 11:59 pm
Reply with quote

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
View user's profile Send private message
Squeak6

New User


Joined: 04 Aug 2005
Posts: 36

PostPosted: Tue Dec 11, 2007 12:17 am
Reply with quote

* 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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Dec 11, 2007 12:37 am
Reply with quote

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
View user's profile Send private message
Squeak6

New User


Joined: 04 Aug 2005
Posts: 36

PostPosted: Tue Dec 11, 2007 12:54 am
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Dec 11, 2007 1:14 am
Reply with quote

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
View user's profile Send private message
Squeak6

New User


Joined: 04 Aug 2005
Posts: 36

PostPosted: Tue Dec 11, 2007 1:30 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top