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

Logic required to fetch the First record using ICETOOL


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

New User


Joined: 19 Oct 2007
Posts: 37
Location: chennai

PostPosted: Fri Aug 02, 2013 11:37 am
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Aug 02, 2013 11:39 am
Reply with quote

Have you searched the forum / manuals about selecting a set number of records from a file.

Clue OPTION STOPAFT=1
Back to top
View user's profile Send private message
karthik3883

New User


Joined: 19 Oct 2007
Posts: 37
Location: chennai

PostPosted: Fri Aug 02, 2013 12:13 pm
Reply with quote

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

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Aug 02, 2013 12:17 pm
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Aug 02, 2013 12:25 pm
Reply with quote

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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Aug 02, 2013 12:44 pm
Reply with quote

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

New User


Joined: 19 Oct 2007
Posts: 37
Location: chennai

PostPosted: Fri Aug 02, 2013 3:22 pm
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Aug 02, 2013 3:35 pm
Reply with quote

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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Aug 02, 2013 4:55 pm
Reply with quote

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Aug 02, 2013 7:13 pm
Reply with quote

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
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 How to split large record length file... DFSORT/ICETOOL 8
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top