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
 
chunk of records to be removed using date

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

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Sep 01, 2008 6:46 pm    Post subject: chunk of records to be removed using date
Reply with quote

Hi,
which containes record indicator starting from 9th position as
DH start of header
DD detail line
DC end of header

DH line has date starting from 41th position as dd/mm/yy

i want output asa data after some date say 05/08/08
output should look like


Code:

MARKSGM,DH,8GB232128892000-1-BER1080801,10/08/08
MARKSGM,DD,8GB232128892000-1-BER1080801,T02-0657-02689784-07917,6403599999,,53.44,,8,,
MARKSGM,DD,8GB232128892000-1-BER1080801,T02-2011-04132097-07550,6403511999,,94.67,,8,,
MARKSGM,DD,8GB232128892000-1-BER1080801,T02-2011-04132110-07550,6403511999,,94.67,,8,,
MARKSGM,DD,8GB232128892000-1-BER1080801,T02-2011-04132134-07550,6403511999,,94.67,,8,,
MARKSGM,DC,8GB232128892000-1-BER1080801,001,22173.10
MARKSGM,DH,8GB232128892000-1-BER1080801,01/09/08
MARKSGM,DD,8GB232128892000-1-BER1080801,T02-0657-02689784-07917,6403599999,,53.44,,8,,
MARKSGM,DD,8GB232128892000-1-BER1080801,T02-2011-04132097-07550,6403511999,,94.67,,8,,
MARKSGM,DD,8GB232128892000-1-BER1080801,T02-2011-04132110-07550,6403511999,,94.67,,8,,
MARKSGM,DD,8GB232128892000-1-BER1080801,T02-2011-04132134-07550,6403511999,,94.67,,8,,
MARKSGM,DC,8GB232128892000-1-BER1080801,001,22173.10

Input
Code:
12345678901234567890123456789012345678901234567890
MARKSGM,DH,8GB232128892000-1-BER1080801,01/08/08
MARKSGM,DD,8GB232128892000-1-BER1080801,T02-0657-02689784-07917,6403599999,,53.44,,8,,
MARKSGM,DD,8GB232128892000-1-BER1080801,T02-2011-04132097-07550,6403511999,,94.67,,8,,
MARKSGM,DD,8GB232128892000-1-BER1080801,T02-2011-04132110-07550,6403511999,,94.67,,8,,
MARKSGM,DD,8GB232128892000-1-BER1080801,T02-2011-04132134-07550,6403511999,,94.67,,8,,
MARKSGM,DC,8GB232128892000-1-BER1080801,001,22173.10
MARKSGM,DH,8GB232128892000-1-BER1080801,02/08/08
MARKSGM,DD,8GB232128892000-1-BER1080801,T02-0657-02689784-07917,6403599999,,53.44,,8,,
MARKSGM,DD,8GB232128892000-1-BER1080801,T02-2011-04132097-07550,6403511999,,94.67,,8,,
MARKSGM,DD,8GB232128892000-1-BER1080801,T02-2011-04132110-07550,6403511999,,94.67,,8,,
MARKSGM,DD,8GB232128892000-1-BER1080801,T02-2011-04132134-07550,6403511999,,94.67,,8,,
MARKSGM,DC,8GB232128892000-1-BER1080801,001,22173.10
MARKSGM,DH,8GB232128892000-1-BER1080801,10/08/08
MARKSGM,DD,8GB232128892000-1-BER1080801,T02-0657-02689784-07917,6403599999,,53.44,,8,,
MARKSGM,DD,8GB232128892000-1-BER1080801,T02-2011-04132097-07550,6403511999,,94.67,,8,,
MARKSGM,DD,8GB232128892000-1-BER1080801,T02-2011-04132110-07550,6403511999,,94.67,,8,,
MARKSGM,DD,8GB232128892000-1-BER1080801,T02-2011-04132134-07550,6403511999,,94.67,,8,,
MARKSGM,DC,8GB232128892000-1-BER1080801,001,22173.10
MARKSGM,DH,8GB232128892000-1-BER1080801,01/09/08
MARKSGM,DD,8GB232128892000-1-BER1080801,T02-0657-02689784-07917,6403599999,,53.44,,8,,
MARKSGM,DD,8GB232128892000-1-BER1080801,T02-2011-04132097-07550,6403511999,,94.67,,8,,
MARKSGM,DD,8GB232128892000-1-BER1080801,T02-2011-04132110-07550,6403511999,,94.67,,8,,
MARKSGM,DD,8GB232128892000-1-BER1080801,T02-2011-04132134-07550,6403511999,,94.67,,8,,
MARKSGM,DC,8GB232128892000-1-BER1080801,001,22173.10


Let me know if anything more is needed
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 Sep 01, 2008 11:44 pm    Post subject:
Reply with quote

Here's a DFSORT job that will do what you asked for using the new WHEN=GROUP function available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008). I assumed your input file has RECFM=FB and LRECL=100, but the job can be changed appropriately for other attributes.

Code:

//S1    EXEC  PGM=ICEMAN                                       
//SYSOUT    DD  SYSOUT=*                                       
//SORTIN DD DSN=...  input file (FB/100)                           
//SORTOUT DD DSN=...  output file (FB/100)
//SYSIN    DD    *                                             
  OPTION COPY                                                   
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(9,2,CH,EQ,C'DH'),             
    PUSH=(101:47,2,103:44,2,105:41,2))                         
  OUTFIL INCLUDE=(101,6,CH,GT,C'080805'),BUILD=(1,100)         
/*


If you don't have PTF UK90013, ask your System Programmer to install it.

For complete details on the new WHEN=GROUP function and the other new functions available with PTF UK90013, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/

Alternatively, you can use more complicated and less efficient technique shown in the "Include or omit groups of records" Smart DFSORT Trick at:

www.ibm.com/systems/support/storage/software/sort/mvs/tricks/
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 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 Copy set of records based on condition krish.deepu SYNCSORT 2 Thu Mar 08, 2018 11:39 am
No new posts add sequence number for duplicate rec... SRUTHI DRAVIDAMANI COBOL Programming 11 Thu Feb 22, 2018 5:37 pm
No new posts how to add the amount for duplicate r... SRUTHI DRAVIDAMANI COBOL Programming 6 Wed Feb 21, 2018 7:21 pm

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