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
 

 

Select records after the master data record

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

New User


Joined: 19 Feb 2008
Posts: 15
Location: chennai

PostPosted: Tue Jun 30, 2009 2:55 pm    Post subject: Select records after the master data record
Reply with quote

Hi friends,

i want to copy the 'n' records after the master record (only one master record will be there in a file)....

master record can be found a definite value in a particular position....

an example

Code:
----+----1----+----2----+----3
qwfgef dfgdfgsdgdsgf21414
dasfsf qe 124 v3 v35`353
12 413r 3 25 456b46
adasfsdf liht2385 ldfdgsdgf
1   ancd     235
2   sample  4235
3   sapl     346
4   wetwe    356
5   wegf    5789
qwfgef dfgdfgsdgdsgf21414
dasfsf qe 124 sqtgwergyw t
----+----1----+----2----+----3


master record is ==> liht2385 in pos 10

i want 5 records after the master record...

likely output is..

Code:
1   ancd     235
2   sample  4235
3   sapl     346
4   wetwe    356
5   wegf    5789


is it possible by default IBM utilities...such as sort, iceman, icetool....etc..?

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

Escapa

Senior Member


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

PostPosted: Tue Jun 30, 2009 7:18 pm    Post subject:
Reply with quote

Fact considered here is
Quote:
(only one master record will be there in a file)....

Also LRECL=80 assumed

Below step will give you required output...

Code:

//STEP0100 EXEC PGM=SORT           
//SYSOUT   DD SYSOUT=*             
//SORTIN   DD *                   
qwfgef dfgdfgsdgdsgf21414         
dasfsf qe 124 v3 v35`353           
12 413r 3 25 456b46               
adasfsdf liht2385 ldfdgsdgf       
1   ancd     235                   
2   sample  4235                   
3   sapl     346                   
4   wetwe    356                   
5   wegf    5789                   
qwfgef dfgdfgsdgdsgf21414         
dasfsf qe 124 sqtgwergyw t                                 
/*                                                         
//SORTOUT  DD SYSOUT=*                                     
//SYSIN    DD *                                           
  SORT FIELDS=COPY                                         
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(10,8,CH,EQ,C'liht2385'),
       PUSH=(81:SEQ=8))                                   
  OUTFIL INCLUDE=(81,8,ZD,GT,1,AND,81,8,ZD,LE,6),BUILD=(1,80)           
/*                                                         


Quote:
is it possible by default IBM utilities...such as sort, iceman, icetool....etc..?

Do you think they are different?
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: Tue Jun 30, 2009 9:46 pm    Post subject:
Reply with quote

Here's another way to do it with DFSORT:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
qwfgef dfgdfgsdgdsgf21414
dasfsf qe 124 v3 v35`353
12 413r 3 25 456b46
adasfsdf liht2385 ldfdgsdgf
1   ancd     235
2   sample  4235
3   sapl     346
4   wetwe    356
5   wegf    5789
qwfgef dfgdfgsdgdsgf21414
dasfsf qe 124 sqtgwergyw t
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(10,8,CH,EQ,C'liht2385'),
     RECORDS=6,PUSH=(81:ID=1))
  OUTFIL OMIT=(10,8,CH,EQ,C'liht2385',OR,81,1,CH,EQ,C' '),
   BUILD=(1,80)                                           
/*
Back to top
View user's profile Send private message
senthilmurugan

New User


Joined: 19 Feb 2008
Posts: 15
Location: chennai

PostPosted: Fri Dec 21, 2012 4:28 pm    Post subject:
Reply with quote

icon_razz.gif Thanks a lot icon_smile.gif BTW sry for the delayed gratitude
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1456
Location: Azeroth

PostPosted: Fri Dec 21, 2012 4:46 pm    Post subject:
Reply with quote

After reading the reply,
For a moment I thought Frank was back.. icon_cry.gif
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 Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 0 Mon Jan 02, 2017 11:16 am
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am


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