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: 1504
Location: Chennai

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 copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 18 Thu Jul 13, 2017 2:11 pm
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts NDM syntax checking without actually ... GAPX1 All Other Mainframe Topics 0 Wed Jun 07, 2017 2:36 am


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