Suppressing the file based on Outrec

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
venky
Active Member
Posts: 50
Joined: Sat May 12, 2012 10:13 pm

Suppressing the file based on Outrec

Post by venky » Tue Sep 11, 2012 1:22 am

Hi,

I have a PS file which contains below records.

01
03
01
03
01
03
01
02
03

01
03
01
02
03

01
03


Now from the above file I want to suppress only the bold records i.e see below

01
02
03
01
02
03

the Outfile should get same order from the input file..I mean only 01 02 03 order records.

Please let me know by using outrec. Thanks.
Last edited by venky on Tue Sep 11, 2012 1:25 am, edited 1 time in total.

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Tue Sep 11, 2012 1:24 am

You mean you want all records which are 01, 02 and 03 in sequence? And the 0301 is a typo?

venky
Active Member
Posts: 50
Joined: Sat May 12, 2012 10:13 pm

Post by venky » Tue Sep 11, 2012 1:29 am

hi William,

Yes, I want the 02 records and also the above 01 record with the tralier record 03, this should be same order from the input file. Please once again look into the above query.Thanks.

Regards,
Venky.

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Tue Sep 11, 2012 8:01 am

I'm still not sure of what you want.

I'm assuming you have "header", 01, "trailer", 03, always. Sometimes one "data", 02.

I'm not sure whether you want to keep or exclued the 01,02,03 groups. So:

This is the first part:

Code: Select all

//DROPGRP EXEC PGM=SORT 
//CHKOUT DD DUMMY 
//SYSOUT   DD SYSOUT=* 
//SORTOUT  DD SYSOUT=* 
//SYSIN    DD * 
  OPTION COPY 
  OUTREC IFTHEN=(WHEN=GROUP, 
                   BEGIN=(1,2,CH,EQ,C'01'),
                   END=(1,2,CH,EQ,C'03'), 
                   PUSH=(3:ID=1)), 
                                           
         IFTHEN=(WHEN=GROUP, 
                   BEGIN=(1,2,CH,EQ,C'01'),
                   RECORDS=3, 
                   PUSH=(4:3,1,7:1,2)), 
                                           
         IFTHEN=(WHEN=GROUP, 
                   BEGIN=(1,2,CH,EQ,C'02'),
                   RECORDS=2, 
                   PUSH=(5:3,1,9:1,2)), 
                                           
         IFTHEN=(WHEN=GROUP, 
                   BEGIN=(1,2,CH,EQ,C'03'),
                   RECORDS=1, 
                   PUSH=(6:3,1)) 
Then, if you want the 01,02,03 records

Code: Select all

 OUTFIL INCLUDE=(3,1,CH,EQ,4,1,CH, 
               AND, 
                 3,1,CH,EQ,5,1,CH, 
               AND, 
                 3,1,CH,EQ,6,1,CH),
        BUILD=(7,2,/,9,2,/,1,2) 
Giving

Code: Select all

01
02
03
01
02
03
Alternatively, if you want the 01,03 records

Code: Select all

  OUTFIL INCLUDE=(1,2,CH,EQ,C'03', 
               AND, 
                 (3,1,CH,NE,4,1,CH, 
                 OR, 
                  3,1,CH,NE,5,1,CH, 
                 OR, 
                  3,1,CH,NE,6,1,CH)),
         BUILD=(7,2,/,1,2) 
Giving

Code: Select all

01
03
01
03
01
03
01
03
01
03

If you want something else, you'll have to be clearer.

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Tue Sep 11, 2012 8:51 am

Hi WC,

If i understand, the desired output is only the "sets" that contain 01, 02, and 03.

TS has not mentioned what to do with a set that has multiple 02s - if that is even possible.
Have a good one

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Tue Sep 11, 2012 11:40 am

He also says he wants to SUPPRESS groups having 02 records. This implies 'do not select theses groups'. Anyway, cannot be done in JCL - suggest moving to the Sort section.
Regards
Nic

venky
Active Member
Posts: 50
Joined: Sat May 12, 2012 10:13 pm

Post by venky » Tue Sep 11, 2012 3:06 pm

hi,

Yes, I want the set of group records that is 01 02 03 records only.

These records are present in 1st position with length 02 in the input file.

Please give me the correct coding. Thank you all.

Regards,
Venky.

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Tue Sep 11, 2012 3:13 pm

venky,
stop wasting our time.
William, in his last post, provided code for such.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

venky
Active Member
Posts: 50
Joined: Sat May 12, 2012 10:13 pm

Post by venky » Tue Sep 11, 2012 3:20 pm

yes dbzThedinasauer, I see the code, but the positons are different, because I am beginner in mainframe...so that's why I have asked again...thank you all once again.

Regards,
Venky

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Tue Sep 11, 2012 3:46 pm

ok,
what positions have changed?
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others