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


     
 
MAINFRAME - TIP OF THE DAY : When you specified V for RECFM parameter, LRECL value is largest record in the file plus 4 bytes. These four bytes contain the actual length of each variable length record in the file

Google
 
Web mainframegurukul.com

test datase empty

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> JCL
  View previous topic :: View next topic  
Author Message
nick.mamone
Member


Joined: 14 Nov 2006
Posts: 3

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

PostPosted: Wed Nov 15, 2006 4:08 pm    Post subject: test datase empty Reply with quote

Hello i'm a new user, i'm italian and don't speak english very well, so excuse me for error. Embarassed

I must test if a dataset is empty and in this instace setting the return code greater zero.
Is possible do this with a proc ibm and without a specific program?

Thanks, and excuse me for english.

Wink
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.

Kalicharan
Moderator


Joined: 08 Feb 2006
Posts: 31

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

PostPosted: Wed Nov 15, 2006 5:46 pm    Post subject: Reply with quote

Hi,

You can get this using ICETOOL or FILEAID or IDCAMS....

Using IDCAMS here is the solution

//STEP01 EXEC PGM=IDCAMS
//IN DD DSN=DATASET <--- Dataset to be checked
//SYSPRINT DD SYSOUT=*
//SYSIN DD DATA
PRINT INFILE(IN) COUNT(1)
/*

This will give RC=0 if file has at least 1 record, otherwise RC=4.


Thanks
Kalicharan
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.
nick.mamone
Member


Joined: 14 Nov 2006
Posts: 3

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

PostPosted: Wed Nov 15, 2006 5:48 pm    Post subject: Reply with quote

thanks!!!!! Very Happy Very Happy Very Happy Very Happy Very Happy
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.
Madhusudana Reddy Mandli
Member


Joined: 15 Nov 2006
Posts: 3

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

PostPosted: Wed Nov 15, 2006 7:35 pm    Post subject: Reply with quote

Kali,

Can you give me how to do this using the FILEAID

Thanks in Advance
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.
Leo
Member


Joined: 14 Nov 2006
Posts: 13
Location: HYBD

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

PostPosted: Fri Nov 17, 2006 4:27 pm    Post subject: Reply with quote

You can check the same using sort .

Code:

//STEP100 EXEC PGM=SORT,PARM='NULLOUT=RC4'
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN= Input file name goes here, 
//            DISP=SHR
//SORTOUT  DD DUMMY
//SYSIN    DD DSN=&CTLCARD(SORTCOPY), --> SORT FIELDS=COPY
//            DISP=SHR


This will give a return code of 4 if the file is empty , you can check for the return code of this step down the line in the job . hope this was helpful

Thanks
Leo
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.
Madhusudana Reddy Mandli
Member


Joined: 15 Nov 2006
Posts: 3

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

PostPosted: Fri Nov 17, 2006 4:39 pm    Post subject: Thanks Reply with quote

Hi Leo,

Thanks a lot.

It looks like a good solution.


Thanks,
Madhu
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.
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 Nov 17, 2006 9:50 pm    Post subject: Reply with quote

Note that Leo's job will only work for z/OS DFSORT V1R5, not for DFSORT R14. Here's a DFSORT/ICETOOL job that will work for both:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file
//TOOLIN DD *
COUNT FROM(IN) EMPTY RC4
/*


For more information, see the "Set RC=12 or RC=4 if file is empty, has more than n records, etc" Smart DFSORT Trick at:

http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/
_________________
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.
justaprogrammer
Member


Joined: 18 Jul 2006
Posts: 6

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

PostPosted: Wed Nov 22, 2006 6:42 pm    Post subject: Reply with quote

You can also use IDCAMS for checking this.

Code:
//FILEMPTY   EXEC   PGM=IDCAMS
//FILEB         DD      DUMMY
//SYSPRINT   DD     SYSOUT=*
//SYSIN         DD    *
    REPRO IDS(input file) OFILE(FILEB) COUNT(1)
/*


This will give a RC = 12 if the file is empty.

You can also use
Code:

PRINT IDS(input file) COUNT(1)

which will give RC=4 when the file is empty.
_________________
Thanks
justaprogrammer
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.
academyindia4
Guest





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

PostPosted: Mon Feb 01, 2016 1:38 am    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 -> JCL 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


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-1254.html