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
 

 

Extract records from file.

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

New User


Joined: 14 Mar 2008
Posts: 74
Location: India,Chennai

PostPosted: Fri Mar 20, 2009 8:32 am    Post subject: Extract records from file.
Reply with quote

Hi i have an requirement in which i have to extract all the records from a file which have value 'fetch' in them. This value can be in any position in the record.The value 'fetch' will always be after 'Include' . Is it possible to do this in sort or any other utility.

Example:
Input file:
123456 Include fetch-1 87456
5487 Include fetch-2 54781
1245 789658 74122

Output:
123456 Include fetch-1 87456
5487 Include fetch-2 54781

Last record should be omitted as it does not have value fetch in it.

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

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Mar 20, 2009 8:40 am    Post subject:
Reply with quote

Hello,

You mention "include" . . . Does this have anything to do with the requirement? If a record had "fetch" but not "include" should it be selected or skipped?

Which sort product is used on your system?
Back to top
View user's profile Send private message
passion_sujesh

New User


Joined: 14 Mar 2008
Posts: 74
Location: India,Chennai

PostPosted: Fri Mar 20, 2009 9:24 am    Post subject: Reply to: Extract records from file.
Reply with quote

If the record has no include then it can be skipped. I am Using DFSORT.
Can you please help me in this.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Mar 20, 2009 9:33 am    Post subject:
Reply with quote

Hi,

try this
Code:
//STEP0001 EXEC PGM=SORT               
//SORTIN   DD *                         
123456 INCLUDE FETCH-1 87456           
5487 INCLUDE FETCH-2 54781             
1245 789658 74122                       
//SORTOUT  DD SYSOUT=*                 
//SYSOUT   DD SYSOUT=*                 
//SYSIN    DD *                         
  SORT FIELDS=COPY                     
  INCLUDE COND=(1,80,SS,EQ,C'FETCH')   
/*                                     



I have assumed the file has an LRECL of 80 and is FB.


Gerry
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Mar 20, 2009 9:38 am    Post subject:
Reply with quote

Hello,

You might try something like:
Code:

  SORT FIELDS=COPY
  INCLUDE COND=(1,80,SS,EQ,C'include fetch')
This should work for a fixed length file of length 080.
Back to top
View user's profile Send private message
passion_sujesh

New User


Joined: 14 Mar 2008
Posts: 74
Location: India,Chennai

PostPosted: Fri Mar 20, 2009 9:54 am    Post subject: Reply to: Extract records from file.
Reply with quote

Thanks dick, it is working fine.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Mar 20, 2009 10:05 am    Post subject: Reply to: Extract records from file.
Reply with quote

You're welcome - thank you for letting us know icon_smile.gif


Gerry, i see you're still quicker on the keyboard icon_cool.gif


d
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Mar 20, 2009 10:22 am    Post subject:
Reply with quote

That's what happens when one stops monkeying around icon_lol.gif


Gerry
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Mar 20, 2009 10:44 am    Post subject: Reply to: Extract records from file.
Reply with quote

Or starts. . . icon_cool.gif

d
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am


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