Page 1 of 1

Skip / Omit a group of records

PostPosted: Fri Feb 14, 2014 11:42 pm
by rajaranganathan
Hi All,

I have requirement that i need to skip/omit a group of records if a key position is '3098'

Here #DMPA is the header record and the #EOT is the trailer/end record in between in the second line value called with "3098 " (Highlighted below) in the position of 19-22 , if that's 3098 i need to remove whole set of Header to trailer. Kindly guide me the options if any.

For your information: Again the second set of records starts with #DDPA and ends with #EOT (same)

Given below is the sample records.

#DMPA FROM 147848151514 TO 544854554 44487484851581851
01022122973114021330987939290****************************************
****************************************
****************************************
****************************************
****************************************
#EOT 000332430 00007
#DDSP FROM 3108861300 TO 054744677 140214 0619 000332430
014822 0221229731 PFEG1402140616-05:0009951
#EOT 000332430 00010


Thanks
Raja.R

Re: Skip / Omit a group of records

PostPosted: Sat Feb 15, 2014 1:36 am
by Terry Heinze
Please use Code tags for readability and uniform character spacing. Example:
This line has been "coded".

Re: Skip / Omit a group of records

PostPosted: Sat Feb 15, 2014 1:37 am
by Terry Heinze
#DMPA FROM 147848151514 TO 544854554 44487484851581851
01022122973114021330987939290****************************************
****************************************
****************************************
****************************************
****************************************
#EOT 000332430 00007
#DDSP FROM 3108861300 TO 054744677 140214 0619 000332430
014822 0221229731 PFEG1402140616-05:0009951
#EOT 000332430 00010


Re: Skip / Omit a group of records

PostPosted: Sat Feb 15, 2014 3:43 pm
by rajaranganathan
Hi Terry,

Thanks for your points, i have an idea that we need to group this and make it but i have no idea how to check for a value and skip the whole group ?

Please advice

Re: Skip / Omit a group of records

PostPosted: Mon Feb 17, 2014 4:48 pm
by NicC
Raja. Your last post was deleted as it breached forum rules. Remember: people reply/assist as and when they want, for free, on their own time. Also, many like to keep their weekend free from work related topics.

Re: Skip / Omit a group of records

PostPosted: Tue Feb 18, 2014 2:54 am
by skolusu
assuming your lrecl=80 and recfm=fb,use the following control cards

//SYSIN    DD *                                                       
  OPTION COPY                                                         
  INREC IFTHEN=(WHEN=GROUP,END=(1,4,CH,EQ,C'#EOT'),                   
  PUSH=(81:ID=8,SEQ=3)),                                               
  IFTHEN=(WHEN=GROUP,BEGIN=(89,3,ZD,EQ,1),PUSH=(100:1,80),RECORDS=2), 
  IFTHEN=(WHEN=GROUP,BEGIN=(89,3,ZD,EQ,2,AND,19,4,CH,EQ,C'3098'),     
  END=(1,4,CH,EQ,C'#EOT'),PUSH=(93:19,4))     
                         
  OUTFIL OMIT=(93,4,CH,EQ,C'3098',OR,89,3,ZD,EQ,1),                   
  IFOUTLEN=80,IFTHEN=(WHEN=(89,3,ZD,EQ,2),BUILD=(100,80,/,1,80))       
//*