Home      Mainframe Forum      Mainfarme Tutorials      IBM Manuals      Mainframe Interview Questions      Mainframe Books      IT News     SiteMap     Downloads


     
 
MAINFRAME - TIP OF THE DAY : All available storage is assigned to the job or jobstep, If REGION is coded 0K or 0M

Google
 
Web mainframegurukul.com

Query on record count in ICETOOL

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities
  View previous topic :: View next topic  
Author Message
biswa
Member


Joined: 27 May 2008
Posts: 4

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed May 28, 2008 10:34 am    Post subject: Query on record count in ICETOOL Reply with quote

Hi,
I'm having 2 files and in a single step I want to count individual records
from both the files and put the individual count in the same output file.

ex:

//STEP1 EXEC PGM=ICETOOL
//SORTIN DD DSN=A.B.C, >>>>> file1 having 2 records
// DISP=(SHR,KEEP,KEEP)
// DD DSN=X.Y.Z,
// DISP=(SHR,KEEP,KEEP) >>>>>> file2 having 4 records


Expected O/P format :

FILE1 2
FILE2 4

I want to do the above in q single step.

Could you please guide me on the same?

Is the same possible in DFSORT?

Thanks & Regards
Biswa.
Back to top
View user's profile Send private message Send e-mail
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.

Frank Yaeger
Moderator


Joined: 18 Feb 2006
Posts: 812
Location: San Jose, CA

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed May 28, 2008 8:10 pm    Post subject: Reply with quote

You can use a DFSORT/ICETOOL job like the following:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD DSN=A.B.C, >>>>> file1 having 2 records
// DISP=(SHR,KEEP,KEEP)
//IN2 DD DSN=X.Y.Z,
// DISP=(SHR,KEEP,KEEP) >>>>>> file2 having 4 records
//**>> Use a MOD output file for //OUT
//OUT DD DISP=MOD,DSN=...  MOD output file
//TOOLIN DD *
COPY FROM(IN1) USING(CTL1)
COPY FROM(IN2) USING(CTL2)
/*
//CTL1CNTL DD *
  OUTFIL FNAMES=OUT,REMOVECC,NODETAIL,
    TRAILER1=('FILE1',5X,COUNT=(M10,LENGTH=5))
/*
//CTL2CNTL DD *
  OUTFIL FNAMES=OUT,REMOVECC,NODETAIL,
    TRAILER1=('FILE2',5X,COUNT=(M10,LENGTH=5))
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Remya
Member


Joined: 23 May 2008
Posts: 2

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu May 29, 2008 8:57 am    Post subject: Reply with quote

Frank Yaeger,

hi,

i have a file with the following lay out:
Wms-code Name Add1 Add2 Zip Error code Description

i want the sort card which gives the followin output file (lay out)
Name Add1 Add2 Zip Error code


Could u please help me with this??

Thanks,
Remya
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
biswa
Member


Joined: 27 May 2008
Posts: 4

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu May 29, 2008 10:25 am    Post subject: Reply with quote

Frank Yaeger,

Thanks for your support.I'm having a another query on the same.

Is there anyway we can avoid writing into O/P files with COUNT of recs as 0 in the below step.(Ex: Suppose file1 contains 0 records)

//CTL1CNTL DD *
OUTFIL FNAMES=OUT,REMOVECC,NODETAIL,
TRAILER1=('FILE1',5X,COUNT=(M10,LENGTH=5))
/*
Back to top
View user's profile Send private message Send e-mail
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Frank Yaeger
Moderator


Joined: 18 Feb 2006
Posts: 812
Location: San Jose, CA

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu May 29, 2008 7:53 pm    Post subject: Reply with quote

Remya,

Please start a new thread for your question since it is NOT related to this thread. In the new thread, give the starting position and length of each input field, and the RECFM and LRECL of the input file and output file.
_________________
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Frank Yaeger
Moderator


Joined: 18 Feb 2006
Posts: 812
Location: San Jose, CA

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu May 29, 2008 7:59 pm    Post subject: Reply with quote

Quote:
Is there anyway we can avoid writing into O/P files with COUNT of recs as 0 in the below step.(Ex: Suppose file1 contains 0 records)


What if one file is empty and the other isn't? What if both files are empty? Please describe what you want to do and show the expected output for all cases.

When you say "avoid writing into O/P files", do you mean avoid writing into the final output file, or do you mean avoid writing into ANY output file such as a temporary file used to determine whether to write into the output file?
_________________
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
biswa
Member


Joined: 27 May 2008
Posts: 4

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Fri May 30, 2008 10:25 am    Post subject: Reply with quote

Frank Yaeger,

1. File1 is having 0 records.
2. File2 is having 2 records.

Below JCL will write the final output file
(//OUT DD DISP=MOD,DSN=... MOD output file) as:

FILE1 0
FILE2 2

//CTL1CNTL DD *
OUTFIL FNAMES=OUT,REMOVECC,NODETAIL,
TRAILER1=('FILE1',5X,COUNT=(M10,LENGTH=5))
/*
//CTL2CNTL DD *
OUTFIL FNAMES=OUT,REMOVECC,NODETAIL,
TRAILER1=('FILE2',5X,COUNT=(M10,LENGTH=5))
/*

My query is I want to write the final output file
(//OUT DD DISP=MOD,DSN=... MOD output file) as:

FILE2 2

Is there anyway we can check the same in the CTL card,like if FILE1 is having record count 0 don't write to the file (//OUT DD DISP=MOD,DSN=... MOD output file).

If both I/P files are empty I want the final O/P file with no records.

If not how it can be achived.

Thanks & Regards
Biswa.
Back to top
View user's profile Send private message Send e-mail
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Frank Yaeger
Moderator


Joined: 18 Feb 2006
Posts: 812
Location: San Jose, CA

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Fri May 30, 2008 7:55 pm    Post subject: Reply with quote

Here's a DFSORT/ICETOOL job that will produce the output you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD DSN=A.B.C, >>>>> file1 having 2 records
// DISP=(SHR,KEEP,KEEP)
//IN2 DD DSN=X.Y.Z,
// DISP=(SHR,KEEP,KEEP) >>>>>> file2 having 4 records
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file
COPY FROM(IN1) USING(CTL1)
COPY FROM(IN2) USING(CTL2)
COPY FROM(T1) TO(OUT) USING(CTL3)
/*
//CTL1CNTL DD *
  OUTFIL FNAMES=T1,REMOVECC,NODETAIL,
    TRAILER1=('FILE1',5X,COUNT=(M10,LENGTH=5))
/*
//CTL2CNTL DD *
  OUTFIL FNAMES=T1,REMOVECC,NODETAIL,
    TRAILER1=('FILE2',5X,COUNT=(M10,LENGTH=5))
/*
//CTL3CNTL DD *
  OMIT COND=(11,5,FS,EQ,0)
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
biswa
Member


Joined: 27 May 2008
Posts: 4

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu Jun 05, 2008 9:50 am    Post subject: Reply with quote

Frank Yaeger,

Frank,

Thanks a lot for your support.It's working the way we expected.

Thanks & Regards
Biswa.
Back to top
View user's profile Send private message Send e-mail
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
academyindia4
Guest





Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Jan 25, 2016 10:59 pm    Post subject: Topic deleted by Admin Reply with quote

<< Content deleted By Admin >>
Back to top
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities All times are GMT + 5 Hours
Page 1 of 1



 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts Stop Run in both called and calling programs !!! 4 arrbee 13179 Mon Feb 01, 2016 10:43 pm
academyindia4 View latest post
No new posts How to use both lower and upper case letters in cobol? 3 Divya 11101 Mon Feb 01, 2016 10:20 pm
academyindia4 View latest post
No new posts two reports to compare , both different format - URGENT 1 ar3 6691 Wed Jul 15, 2009 7:57 pm
Frank Yaeger View latest post
No new posts If both the JOBCAT & STEPCAT statements are coded in a s 1 Krishna 7326 Tue May 12, 2009 6:43 pm
Krishna View latest post
No new posts Commit both in DB2 and MQ 3 jackie 9360 Fri Jul 27, 2007 3:52 pm
dbzTHEdinosauer View latest post
 


Cobol Tutorial
This cobol tutorial covers most of the important topics like STRING, UNSTRING, COMP, COMP-3.....
DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. Explains in simple language. Some Chapters are locked, Forum members have free access to these chapters
CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming...
JCL Tutorial
This is most popular JCL tutorial from mainframegurukul. It does contain important jcl ....
SORT Tutorial
This Tutorial covers all important aspects of DFSORT. Has more SORT examples
INTERVIEW Questions
This page covers important interview questions
Mainframe Jobs
Mainframe Jobs posted by members of mainframegurukul forum
FaceBook Page
MainframeGurukul FaceBook Page
LinkedIn Page
MainframeGurkul Linkedin Page

This widget requires Flash Player 9 or better







Go to top of the page
 

Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  DB2 INTERVIEW QUESTIONS ||  COBOL INTERVIEW QUESTIONS  ||  JCL INTERVIEW QUESTIONS ||  JCL2 INTERVIEW QUESTIONS ||  VSAM INTERVIEW QUESTIONS ||  CICS INTERVIEW QUESTIONS  ||  Online tutorials ||  Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap  ||  Expeditor Tutorial  ||  FILE-AID Tutorial  ||  Changeman Tutorial  ||  COBOL   ||  DB2   ||  JCL  ||  CICS  ||  VSAM  ||  DB2 Interview Questions ( 110 )   || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1 ;|| Mainframe Forum - Tutorials  || Mainframe Tutorials || Mainframe CICS tutorial|| Mainframe COBOL Tutorial

Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Powered by phpBB

mainframetopic-3297.html