Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Count of omitted records excluded by OMIT condition.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Thu Nov 27, 2008 9:25 pm    Post subject: Count of omitted records excluded by OMIT condition.
Reply with quote

Hi,

I am using below job to write data to o/p file but the customer wants the count of each variety excluded using OMIT condition to appear in SYSOUT ! The file RECFM is FB and LRECL is 400.

Code:

//SYSIN     DD *                                             
 SORT FIELDS=COPY                                             
 OMIT COND=(1,3,CH,EQ,C'HDR',OR,1,3,CH,EQ,C'ETR',OR,       
            1,20,CH,EQ,C'                    ',OR,           
            1,20,CH,EQ,C'99999999999999999999')               
 OUTFIL FILES=(OUT,1),                                       
        IFTHEN=(WHEN=(1,34,CH,EQ,C'TLR'),BUILD=(40,361,29X)),
        IFTHEN=(WHEN=NONE,BUILD=(1,400))                     


Here a total of 4 types of input records are excluded:

Quote:

HDR
ETR
If record has 20 spaces starting at 1st column
If record has 20 9s starting at 1st column


So, I would like to have these 4 counts to be appeared in SYSOUT. Also, please let me know if the 20 spaces and 9s can be represented in any other format instead of typing it that long !

Thanks.
Back to top
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2239
Location: @my desk

PostPosted: Sat Nov 29, 2008 12:47 am    Post subject:
Reply with quote

Ramsri,

What is the purpose of this? Why routing the same data to 2 different ddnames?
Code:
 OUTFIL FILES=(OUT,1),   
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2239
Location: @my desk

PostPosted: Sat Nov 29, 2008 1:00 am    Post subject:
Reply with quote

Ramsri,

Please post some sample input records and the expected output out of it. Do you need the output records in the same order as input or the order doesn't matter?
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Sat Nov 29, 2008 2:32 pm    Post subject: Reply to: Count of omitted records excluded by OMIT conditio
Reply with quote

arcvns,

We create two files because one file will be reformatted and another one will be used in other job steps. We strip first 27 bytes, exclude other types and write remaining records. So, I need the output records in same order as in input file.

Sample Recrods:
Code:

ETR9999999999999999999999999999999999999999999999999999999999999999999999999999
99999999999999999999999999999999999999999999999999999999999999999999999999999999
HDRIFZ         081128214543     00907                                         
                                                                               
TLR311224VOM   11281703SUPERMGMT  E   00000121454     TIM200711281703OMGUIORIENA000062
00000121454     NA132008          000001131860000200000118445000011AT46   0001 
00000121454     NB13+14B +1LS +50U +B36 +F1A +FE9 +MX0 +PCW +R8N +R8P +RFA +VK3
00000121454     NA482008          00000119390000020000011375800001TK10906 0001 


Output:

Code:

00000121454     TIM200711281703OMGUIORIENA000062                               
00000121454     NA132008          000001131860000200000118445000011AT46   0001
00000121454     NB13+14B +1LS +50U +B36 +F1A +FE9 +MX0 +PCW +R8N +R8P +RFA +VK3
00000121454     NA482008          00000119390000020000011375800001TK10906 0001


Thanks.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2239
Location: @my desk

PostPosted: Sat Nov 29, 2008 5:24 pm    Post subject:
Reply with quote

Ramsri,
Quote:
We strip first 27 bytes
You mentioned about stripping 27 bytes, but in the initial card you have taken off first 39 bytes for "TLR" records. Again from the posted sample data, the first 38 bytes seems to be ignored for these records. Please explain.
Input
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
TLR311224VOM   11281703SUPERMGMT  E   00000121454     TIM200711281703OMGUIORIENA000062

Output
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
00000121454     TIM200711281703OMGUIORIENA000062
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Sun Nov 30, 2008 5:59 pm    Post subject: Reply to: Count of omitted records excluded by OMIT conditio
Reply with quote

Arun, sorry for the confusion. icon_neutral.gif Yes. It is 39 bytes we want to strip off on TLR recrods.

Code:

//SYSIN     DD *                                             
 SORT FIELDS=COPY                                             
 OMIT COND=(1,3,CH,EQ,C'HDR',OR,1,3,CH,EQ,C'ETR',OR,       
            1,20,CH,EQ,C'                    ',OR,           
            1,20,CH,EQ,C'99999999999999999999')               
 OUTFIL FILES=(OUT,1),                                       
        IFTHEN=(WHEN=(1,3,CH,EQ,C'TLR'),BUILD=(40,361,39X)),
        IFTHEN=(WHEN=NONE,BUILD=(1,400))


Thanks.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2239
Location: @my desk

PostPosted: Mon Dec 01, 2008 6:45 pm    Post subject:
Reply with quote

Ramsri,

From whatever info has been posted so far, the below Syncsort job should do the trick for you. Try this and post back if you face any issues.
REJCNT in SYSOUT will have the required counts.
Code:
//STEP1    EXEC PGM=SORT                                         
//SORTIN   DD DSN=XXXXXXX.FB400.IN                               
//SYSOUT   DD SYSOUT=*                                           
//OUT      DD DSN=XXXXXXX.FB400.OUT                             
//REJCNT   DD SYSOUT=*                                           
//SYSIN    DD *                                                 
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(404:SEQNUM,8,ZD,C'00000000')),
        IFTHEN=(WHEN=(1,3,SS,EQ,C'HDR,ETR'),                     
                    OVERLAY=(401:1,3,6X,C': 00000001')),         
        IFTHEN=(WHEN=(1,20,CH,EQ,C' '),                         
                    OVERLAY=(401:C'20 SPACES',C': 00000001')),   
        IFTHEN=(WHEN=(1,20,CH,EQ,C'99999999999999999999'),       
                    OVERLAY=(401:C'20 9s    ',C': 00000001'))   
  SORT FIELDS=(401,11,CH,A)                                     
  SUM FIELDS=(412,8,ZD)                                         
  OUTFIL FNAMES=OUT,OMIT=(410,1,CH,EQ,C':'),BUILD=(40,361,400:X)
  OUTFIL FNAMES=REJCNT,SAVE,BUILD=(401,19)     
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Tue Dec 02, 2008 4:32 pm    Post subject: Reply to: Count of omitted records excluded by OMIT conditio
Reply with quote

Thank you. I am getting the counts as expected but the records are getting truncated!

Input Data:

Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
TLR311057AOM   12011501SUPERMGMT  B   00000164118     AOM200812011501OMGUIORIER
00000161118     NA112909          000001845750000400000187434000014HP69   000156
00000161118     NB09+FVX +LGD +MX0 +1CX +FE9 +25U +83B +R6T +VQ2               
00000161118     NA132909          000001131690000300000113397000011ZG69   000156
00000161118     NB11+LE5 +MN5 +1FL +FE9 +92U +34B +AG1 +B86 +FVX +R6T +VQ2     
00000161118     NA222909          00000121777000060000012195800001ZR14526 000156
00000161118     NB14+LLT +MY9 +1XE +QLW +FE9 +51U +19C +ABB +PDC +QD6 +R6T +VI8


Wrong Output:

Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
00000161118     AOM200812011501OMGUIORIERA000006   
1845750000400000187434000014HP69   000156315FLS   
 +FE9 +25U +83B +R6T +VQ2                         
1131690000300000113397000011ZG69   000156330FLS   
 +92U +34B +AG1 +B86 +FVX +R6T +VQ2               
121777000060000012195800001ZR14526 000156325FLS   
 +FE9 +51U +19C +ABB +PDC +QD6 +R6T +VI8 +VQ2 +GW5


Expected Output:

Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
00000161118     AOM200812011501OMGUIORIERA000006
00000161118     NA112909          000001845750000400000187434000014HP69   000156
00000161118     NB09+FVX +LGD +MX0 +1CX +FE9 +25U +83B +R6T +VQ2               
00000161118     NA132909          000001131690000300000113397000011ZG69   000156
00000161118     NB11+LE5 +MN5 +1FL +FE9 +92U +34B +AG1 +B86 +FVX +R6T +VQ2     
00000161118     NA222909          00000121777000060000012195800001ZR14526 000156
00000161118     NB14+LLT +MY9 +1XE +QLW +FE9 +51U +19C +ABB +PDC +QD6 +R6T +VI8


Thanks again.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2239
Location: @my desk

PostPosted: Tue Dec 02, 2008 6:04 pm    Post subject:
Reply with quote

Quote:
Thank you. I am getting the counts as expected but the records are getting truncated!
Ramsri,

Yes, I forgot to add the condition in your initial sort card for "non-TLR" data records. Here's the modified version.
Code:
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(404:SEQNUM,8,ZD,C'00000000')),
        IFTHEN=(WHEN=(1,3,SS,EQ,C'HDR,ETR'),                     
                    OVERLAY=(401:1,3,6X,C': 00000001')),         
        IFTHEN=(WHEN=(1,20,CH,EQ,C' '),                         
                    OVERLAY=(401:C'20 SPACES',C': 00000001')),   
        IFTHEN=(WHEN=(1,20,CH,EQ,C'99999999999999999999'),       
                    OVERLAY=(401:C'20 9S    ',C': 00000001'))   
  SORT FIELDS=(401,11,CH,A)                                     
  SUM FIELDS=(412,8,ZD)                                         
  OUTFIL FNAMES=OUT,OMIT=(410,1,CH,EQ,C':'),                     
         IFTHEN=(WHEN=(1,3,CH,EQ,C'TLR'),BUILD=(40,361,400:X)), 
         IFTHEN=(WHEN=NONE,BUILD=(1,400))                       
  OUTFIL FNAMES=REJCNT,SAVE,BUILD=(401,19)     
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Tue Dec 02, 2008 7:02 pm    Post subject: Reply to: Count of omitted records excluded by OMIT conditio
Reply with quote

Arun, Excellent. I got it as expected. icon_biggrin.gif

Thank you very much......

Bye.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2239
Location: @my desk

PostPosted: Tue Dec 02, 2008 7:43 pm    Post subject:
Reply with quote

Ramsri,

You're welcome.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Display FTP Session Count within TSO Yolanda Harvey TSO/ISPF 3 Fri Mar 10, 2017 10:31 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us