Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Several files from one file...

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Several files from one file...
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    Post subject:
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    Post subject:
Reply with quote

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

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

DFSORT Moderator


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

PostPosted: Mon Dec 10, 2007 11:59 pm    Post subject:
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:

http://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    Post subject:
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 Moderator


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

PostPosted: Tue Dec 11, 2007 12:37 am    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10358
Location: italy

PostPosted: Tue Dec 11, 2007 1:14 am    Post subject: Reply to: Several files from one file...
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 1 Tue Nov 21, 2017 9:23 pm
No new posts unable to set RC = 4 when empty file migusd SYNCSORT 1 Tue Nov 21, 2017 1:21 am
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts Updating data from one file to other!!! Vignesh Sid SYNCSORT 1 Mon Nov 06, 2017 2:42 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us