IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Sortout check for empty report


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vaishalisingh

New User


Joined: 07 Feb 2008
Posts: 4
Location: delhi

PostPosted: Wed May 07, 2008 11:31 am
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
Prajesh_v_p

Active User


Joined: 24 May 2006
Posts: 133
Location: India

PostPosted: Wed May 07, 2008 2:46 pm
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 Developer


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

PostPosted: Wed May 07, 2008 9:21 pm
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:

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: 31
Location: Spain

PostPosted: Wed May 07, 2008 10:55 pm
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts WER247A SORTOUT HAS INCOMPATIBLE LRECL SYNCSORT 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts Need help on formatting a report DFSORT/ICETOOL 14
No new posts Creating Report using SORT DFSORT/ICETOOL 7
Search our Forums:

Back to Top