Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Reject group of records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
zh_lad

Active User


Joined: 06 Jun 2009
Posts: 101
Location: UK

PostPosted: Mon Oct 11, 2010 9:21 pm    Post subject: Reject group of records
Reply with quote

Hi,

LRECL = 500
Account number, P=1, L=36

It has got group of records per account. Header followed by detail records, however, no trailer. Header is always the first record.

Header record P=43, L=2, Value = CU
Details records have got values TX, MX, DR, EX, IA, PF or DR etc on P=43, L=2

I would like to reject those group of records which havn't got any DR record.

Input
701647330050000000016338341900000025 CU100000000001500300002 0
701647330050000000016338341900000025 IA400000000021500300002GBP0035
701647330050000000016338341900000025 LC8000000000000001CASH LIMIT 2
701647330050000000016338341900000025 MX800000000010002GBP0000001001
701647330050000000016338341900000025 MC800000000091002GBP0000009002
701647330050000000016338341900000025 CL11000000000100000005202VAL
701647330050000000016338341900000025 EX200000000000002GBP 030000000
701647330050000000016338341900000025 TX300000000004002GBPPU04000000
701647350050000000026338341901103521 CU100000000001500300001 0
701647350050000000026338341901103521 MX800000000270001GBP0000027020
701647350050000000026338341901103521 MC800000000341001GBP0000034002
701647350050000000026338341901103521 CL11000000000100000735705COLIN
701647350050000000026338341901103521 IA400000000020500300001GBP0034
701647350050000000026338341901103521 LC8000000000000001CASH LIMIT 2
701647350050000000026338341901103521 DR110000000002UK36
701647350050000000026338341901103521 EX200000000000001GBP 030000000
701647350050000000026338341901103521 TX300000000008001GBPPU04000000
701647350050000000026338341901103521 IA400000000010500300001GBP0010

Output
Good records
701647350050000000026338341901103521 CU100000000001500300001 0
701647350050000000026338341901103521 MX800000000270001GBP0000027020
701647350050000000026338341901103521 MC800000000341001GBP0000034002
701647350050000000026338341901103521 CL11000000000100000735705COLIN
701647350050000000026338341901103521 IA400000000020500300001GBP0034
701647350050000000026338341901103521 LC8000000000000001CASH LIMIT 2
701647350050000000026338341901103521 DR110000000002UK36
701647350050000000026338341901103521 EX200000000000001GBP 030000000
701647350050000000026338341901103521 TX300000000008001GBPPU04000000
701647350050000000026338341901103521 IA400000000010500300001GBP0010

Reject records (rejected becuase it hasn't got a DR record in group)
701647330050000000016338341900000025 CU100000000001500300002 0
701647330050000000016338341900000025 IA400000000021500300002GBP0035
701647330050000000016338341900000025 LC8000000000000001CASH LIMIT 2
701647330050000000016338341900000025 MX800000000010002GBP0000001001
701647330050000000016338341900000025 MC800000000091002GBP0000009002
701647330050000000016338341900000025 CL11000000000100000005202VAL
701647330050000000016338341900000025 EX200000000000002GBP 030000000
701647330050000000016338341900000025 TX300000000004002GBPPU04000000

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

zh_lad

Active User


Joined: 06 Jun 2009
Posts: 101
Location: UK

PostPosted: Mon Oct 11, 2010 10:45 pm    Post subject:
Reply with quote

The DR record has only one occurrence in a group. Based on this and using file matching technique (NONDUPS etc), I have created a file only consisting those headers (CU record type) which haven't got any DR. It is possible to omit group of these headers from main file.

Many thanks.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Mon Oct 11, 2010 11:17 pm    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for using just the original input file.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN DD DSN=...  input file (FB/500)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT1 DD DSN=...  output file1 (FB/500)
//OUT2 DD DSN=...  output file2 (FB/500)
//TOOLIN DD *
COPY FROM(IN) USING(CTL1)
COPY JKFROM USING(CTL2)
/*
//CTL1CNTL DD *
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(43,2,CH,EQ,C'CU'),PUSH=(501:ID=8))
  OUTFIL FNAMES=T1,INCLUDE=(43,2,CH,EQ,C'DR')
/*
//JNF2CNTL DD *
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(43,2,CH,EQ,C'CU'),PUSH=(501:ID=8))
/*
//CTL2CNTL DD *
  JOINKEYS F1=T1,FIELDS=(501,8,A),SORTED,NOSEQCK
  JOINKEYS F2=IN,FIELDS=(501,8,A),SORTED,NOSEQCK
  JOIN UNPAIRED,F2
  REFORMAT FIELDS=(F2:1,500,?)
  OUTFIL FNAMES=OUT1,INCLUDE=(501,1,CH,EQ,C'B'),BUILD=(1,500)
  OUTFIL FNAMES=OUT2,INCLUDE=(501,1,CH,EQ,C'2'),BUILD=(1,500)
/*
Back to top
View user's profile Send private message
zh_lad

Active User


Joined: 06 Jun 2009
Posts: 101
Location: UK

PostPosted: Tue Oct 12, 2010 6:27 pm    Post subject:
Reply with quote

Thank you very much Frank. Regards.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts MXG - Processing Compressed DB2 SMF r... vasanthz All Other Mainframe Topics 2 Thu May 10, 2018 12:47 am
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm
No new posts Group changes and numbering the groups Auryn DB2 2 Tue Mar 20, 2018 7:12 pm
No new posts Copy set of records based on condition krish.deepu SYNCSORT 2 Thu Mar 08, 2018 11:39 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us