Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Logic required to fetch the First record using ICETOOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Logic required to fetch the First record using ICETOOL
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: 8593
Location: Back in jolly old England

PostPosted: Fri Aug 02, 2013 11:39 am    Post subject:
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    Post subject: Reply to: Logic required to fetch the First record using ICE
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: 1703
Location: Australia

PostPosted: Fri Aug 02, 2013 12:17 pm    Post subject: Reply to: Logic required to fetch the First record using ICE
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: 8593
Location: Back in jolly old England

PostPosted: Fri Aug 02, 2013 12:25 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Aug 02, 2013 12:44 pm    Post subject: Reply to: Logic required to fetch the First record using ICE
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    Post subject: Reply to: Logic required to fetch the First record using ICE
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: 8593
Location: Back in jolly old England

PostPosted: Fri Aug 02, 2013 3:35 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Aug 02, 2013 4:55 pm    Post subject: Reply to: Logic required to fetch the First record using ICE
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

Site Director


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

PostPosted: Fri Aug 02, 2013 7:13 pm    Post subject:
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    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 How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts ICETOOL/SYNCSORT - SYSPRINT output nartcr DFSORT/ICETOOL 17 Wed Oct 05, 2016 10:46 pm
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us