Create a report from a file only If some records found



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Create a report from a file only If some records found

Postby javivi » Thu Feb 03, 2011 5:47 pm

Hi

I have a file with 150 recl and i need to generate a simple report only if in the file we have records with a ASTERIC in the position 125.
Every record with a asterisc must be print. If no one record exist with a asteric in pos 125, I need to create the report only with a text: TODAY WE HAVE NO ERRORS.

It is possible?
javivi
 
Posts: 47
Joined: Fri Jan 21, 2011 2:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Create a report from a file only If some records found

Postby skolusu » Thu Feb 03, 2011 10:40 pm

javivi,

Use the following DFSORT JCL which will give you the desired results. Step0100 will set a return code of 4 when your input file does not have '*' records. step0200 will ONLY run when you don't have '*' records.

//STEP0100 EXEC PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                           
//SORTIN   DD DSN=Your input file,DISP=SHR
//SORTOUT  DD DSN=Your Output file,
//            DISP=(New,CATLG,DELETE),
//            SPACE=(CYL,(X,Y),RLSE)
//SYSIN    DD *                                                 
  OPTION COPY,NULLOUT=RC4                                       
  INCLUDE COND=(125,1,CH,EQ,C'*')                               
//*                                                             
//STEP0200 EXEC PGM=SORT,COND=(0,EQ,STEP0100)                   
//SYSOUT   DD SYSOUT=*                                           
//SORTIN   DD DSN=Your Output file from step0100,DISP=SHR
//SORTOUT  DD SYSOUT=*                                           
//SYSIN    DD *                                                 
  OPTION COPY                                                   
  OUTFIL REMOVECC,BUILD=(80X),                                   
  HEADER1=('ON ',DATE=(4MD-),' WE HAVE NO ERRORS.')             
//*
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post