Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Sortout check for empty report

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
Author Message
vaishalisingh

New User


Joined: 07 Feb 2008
Posts: 1
Location: delhi

PostPosted: Wed May 07, 2008 11:31 am    Post subject: Sortout check for empty report
Reply with quote

Hi,

In my first step i am sorting a particular report.

In my second step i have to check if the output of the sort step(previous) produced no records then Print "empty report" in that sortout file.

please advise !
Back to top
View user's profile Send private message
References
PostPosted: Wed May 07, 2008 11:31 am    Post subject: Re: Sortout check for empty report Reply with quote

Moved: Wed May 07, 2008 1:06 pm by superk From JCL to DFSORT/ICETOOL
Prajesh_v_p
Warnings : 1

Active User


Joined: 24 May 2006
Posts: 95
Location: India

PostPosted: Wed May 07, 2008 2:46 pm    Post subject:
Reply with quote

Can you check this logic?

Step 1) Use IDCAMS to check empty report condition
PRINT INFILE(DDIN) COUNT(1) CHAR

If RC GT 0
Step 2) Copy "empty report" to sortout file
if RC EQ 0
Step 3) Sort the report

Thanks,
Prajesh
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 3777
Location: San Jose, CA

PostPosted: Wed May 07, 2008 9:21 pm    Post subject:
Reply with quote

YOu can do this all with DFSORT/ICETOOL. You don't need IDCAMS.

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/

If that doesn't help, then show your first step.
Back to top
View user's profile Send private message
gabriel.ryoga

New User


Joined: 07 Jun 2007
Posts: 17
Location: Spain

PostPosted: Wed May 07, 2008 10:55 pm    Post subject:
Reply with quote

I think that this are the steps you need, just put in the STEP 2 a SORT to copy the text you need.

Code:

//STEP1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...
//TOOLIN DD *
COUNT FROM(IN) EMPTY
/*
// IF STEP1.RC = 12 THEN
//*
//* STEP2 WILL RUN IF 'IN' IS EMPTY
//STEP2 EXEC ...
...
// ENDIF
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1