View previous topic :: View next topic
|
Author |
Message |
karthik3883
New User
Joined: 19 Oct 2007 Posts: 37 Location: chennai
|
|
|
|
Hi,
I have a requirement where i have 68 input files, each input file has a header at the first record,I need to fetch headers from each of the 68 file and place it in output file for validation by cobol program later.
can you please let me know how this can be achieved in ICETOOL
Regards
Karthik |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Have you searched the forum / manuals about selecting a set number of records from a file.
Clue OPTION STOPAFT=1 |
|
Back to top |
|
|
karthik3883
New User
Joined: 19 Oct 2007 Posts: 37 Location: chennai
|
|
|
|
Hi Expat,
By my requirement is like this
//IN1 DD DSN=FILE1,DISP=SHR
// DD DSN=FILE2,DISP=SHR
// DD DSN=FILE3,DISP=SHR
// DD DSN=FILE4,DISP=SHR
// DD DSN=FILE5,DISP=SHR
// DD DSN=FILENN,DISP=SHR
//OUT DD DSN=FILEOUT,DISP=SHR.
In this case STOPAFT will work?
Regards
Karthik |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
is there a way to identify the header ?
If so, just use INCLUDE COND=
This method will read all the records in the 68 files.
Option given by Expat is a better option if you have a huge number of records except you will need to run it against each file separately
Gerry |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Allocate each file to its own DDNAME and STOPAFT=1 works perfectly.
Code: |
//TOOLIN DD *
COPY FROM(SORTINxx) TO(SORTOUT) USING(CPY1)
COPY FROM(SORTINxx) TO(SORTOUT) USING(CPY1)
COPY FROM(SORTINxx) TO(SORTOUT) USING(CPY1)
COPY FROM(SORTINxx) TO(SORTOUT) USING(CPY1)
COPY FROM(SORTINxx) TO(SORTOUT) USING(CPY1)
/*
//CPY1CNTL DD *
OPTION STOPAFT=1
/*
// |
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You'll need DISP=MOD for your output.
Also, what are your RECFMs amd lLRECLs for all the datasets? You'll need something to deal with that. Not much, but something. |
|
Back to top |
|
|
karthik3883
New User
Joined: 19 Oct 2007 Posts: 37 Location: chennai
|
|
|
|
Hi Expat,
I have included your logic
but the output is giving me header from the first file alone, where as the header from second and consequtive files are missing
Regards
Karthik |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Did you .................................................................
a) Allocate every input file to its own unique DD name
b) Use DISP=MOD for the SORTOUT DD
c) Change the control statements to point to each of the unique DD names |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
And, if your files are all VB, you are OK.
If they are all FB, you have to make them all the size of the largest data required.
If you have a mix of FB and VB...? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I have included your logic |
You need to post the JCL and sort control submitted as well as the informational messages generated by the run. Make sure the message ids are shown. |
|
Back to top |
|
|
|