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 in a file.

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

New User


Joined: 28 Sep 2007
Posts: 71
Location: India.

PostPosted: Fri Sep 25, 2009 12:37 pm    Post subject: Select records in a file.
Reply with quote

Hi,

I have an input file which looks like the one below.

5T37 4373950054835 LE 0102....07821448033509
7T37 4373950054835 LE 01020152S000003
7T37 4373950054835 LE 01020165S000002
7T37 4373950054835 LE 01022600S000002
7T37 4373950054835 LE 01022972S000003
7T37 4373950054835 LE 01023777S000002
7T37 4373950054835 LE 01023955S000003
5T37 4373950054835 LE 0103....07821455033509
7T37 4373950054835 LE 01030152S000001
7T37 4373950054835 LE 01030165S000001
7T37 4373950054835 LE 01032600S000001
7T37 4373950054835 LE 01032972S000001
5T37 4373950054835 LE 0202....07821462033509
7T37 4373950054835 LE 02020152S000007
7T37 4373950054835 LE 02020165S000005
7T37 4373950054835 LE 02022600S000005
5T37 4373950022023 JC 0200....03540701033449
7T37 4373950022023 JC 02000152S000009
7T37 4373950022023 JC 02002972S000009
7T37 4373950022023 JC 02003955S000009
7T37 4373950022023 JC 02004048S000009
7T37 4373950022023 JC 02004129S000009
5T37 4373950022023 JC 0300....01001129033449
7T37 4373950022023 JC 03000152S000008

Here, in the output file I should have the records starting with '5T' and then followed by records starting with '7T'. but only a maximum of 3 '7T' records can follow the '5T' records.

Any idea would be of really a great Help.

Thanks,
Sathya.
Back to top
View user's profile Send private message

Escapa

Senior Member


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

PostPosted: Fri Sep 25, 2009 2:06 pm    Post subject:
Reply with quote

Below sortstep will give you desired result. I have assumed LRECL=80

Code:

//STEP010 EXEC PGM=SORT                                 
//DFSMSG  DD SYSOUT=*                                   
//SYSPRINT DD SYSOUT=*                                   
//SYSOUT DD SYSOUT=*                                     
//SORTIN DD *
5T37 4373950054835 LE 0102....07821448033509
7T37 4373950054835 LE 01020152S000003
7T37 4373950054835 LE 01020165S000002
7T37 4373950054835 LE 01022600S000002
7T37 4373950054835 LE 01022972S000003
7T37 4373950054835 LE 01023777S000002
7T37 4373950054835 LE 01023955S000003
5T37 4373950054835 LE 0103....07821455033509
7T37 4373950054835 LE 01030152S000001
7T37 4373950054835 LE 01030165S000001
7T37 4373950054835 LE 01032600S000001
7T37 4373950054835 LE 01032972S000001
5T37 4373950054835 LE 0202....07821462033509
7T37 4373950054835 LE 02020152S000007
7T37 4373950054835 LE 02020165S000005
7T37 4373950054835 LE 02022600S000005
5T37 4373950022023 JC 0200....03540701033449
7T37 4373950022023 JC 02000152S000009
7T37 4373950022023 JC 02002972S000009
7T37 4373950022023 JC 02003955S000009
7T37 4373950022023 JC 02004048S000009
7T37 4373950022023 JC 02004129S000009
5T37 4373950022023 JC 0300....01001129033449
7T37 4373950022023 JC 03000152S000008
//SORTOUT DD SYSOUT=*
//SYSIN DD *                                                       
  OPTION COPY                                                       
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,2,CH,EQ,C'5T'),PUSH=(81:SEQ=8))
  OUTFIL INCLUDE=(81,8,ZD,LE,4),BUILD=(1,80)                       
/*                                                                 
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