IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

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: 8793
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: 8793
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: 7312
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: 8793
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: 7312
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: 19251
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 All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts Hexadecimal Group compare and write t... DFSORT/ICETOOL 5
This topic is locked: you cannot edit posts or make replies. Splice JCL into one record for DD sta... SYNCSORT 2
No new posts Copying data from prev record using SORT SYNCSORT 19
No new posts Break a record into fields, each fiel... SYNCSORT 2
No new posts Creating a single-record file with CO... DFSORT/ICETOOL 8

Back to Top