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
 

 

Skip Initial records in a File

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

New User


Joined: 23 Sep 2011
Posts: 12
Location: Chennai

PostPosted: Thu Apr 26, 2012 4:23 pm    Post subject: Skip Initial records in a File
Reply with quote

I have a file (LRECL=8, RECFM=FB), there are n number of records in that file(file is creating in one of the PGM).
Data in the file is :
Code:
24150010
55542110
24150910
71251210
.
.
.
27665410
28551610 (till n number)
85509911
00154411
.
.
.
33456511
65627611(till n number)
55389410
20305610
72705510
.
.
.
66892010(till n number)
 

Out put as :
Code:
55389410
20305610
72705510
.
.
.
66892010(till n number)
 

Note : 7th position there is only 10 and 11 value; I want only the 10 present in 7 position after 11 in 7 position.

Is there any way to get this solution?
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Apr 26, 2012 4:44 pm    Post subject: Reply to: Skip Initial records in a File
Reply with quote

It is not clear what you mean. Can you show expected output, please.

In the Code tags.
Back to top
View user's profile Send private message
vasantha.gl

New User


Joined: 23 Sep 2011
Posts: 12
Location: Chennai

PostPosted: Thu Apr 26, 2012 5:12 pm    Post subject: Reply to: Skip Initial records in a File
Reply with quote

For Example if the input file contains 10 records as
Code:
XXXXXX10
XXXXXX10
XXXXXX10
XXXXXX11
XXXXXX11
XXXXXX11
XXXXXX10
XXXXXX10
XXXXXX10
XXXXXX10  (where XXXXXX is numbers)

I need to out put as
Code:
XXXXXX10
XXXXXX10
XXXXXX10
XXXXXX10

Last four records are expected out put.
Need to write a file with records having '10' at 7th position, only the Records after '11' at 7th position.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Apr 26, 2012 5:38 pm    Post subject: Reply to: Skip Initial records in a File
Reply with quote

Still confusing.

You only want the records with '10' at that position? Or you want to ignore all the '11's and have anything else (which is only '10's in your sample)?

How about INCLUDE or OMIT?
Back to top
View user's profile Send private message
vasantha.gl

New User


Joined: 23 Sep 2011
Posts: 12
Location: Chennai

PostPosted: Thu Apr 26, 2012 5:48 pm    Post subject: Reply to: Skip Initial records in a File
Reply with quote

one more Example
Code:
AAAAAA10
BBBBBA10
BBBBBB10
BBBBBC11
DDDDDD11
DDDDDE11
AAAABB10
AAAABD10
AAAADD10

GGGGGG10

O/P NEEDED AS
Code:
AAAABB10
AAAABD10
AAAADD10
GGGGGG10



RECORDS AFTER 11 IN 08TH POSITION HAVING 10 AT 08TH POSITION SHOULD BE WRITTEN TO THE OUTPUT FILE(HERE IN THE ABOVE EXPALE LAST 4 RECORDS SATIESFIES THESE CONDITION).
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Apr 26, 2012 6:17 pm    Post subject:
Reply with quote

Bill,
stop being obtuse.

the requirement is very clear.

read a file and start outputting
when you have a '10' in positions 8 and 9
after you have read the last record which has a '11' in 8 and 9.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Apr 26, 2012 6:28 pm    Post subject: Reply to: Skip Initial records in a File
Reply with quote

OK, thanks dbz.

That'd be a GROUP with KEYBEGIN, PUSH an ID and output with ID equal to or greater than three (so, INCLUDE). With that data, anyway.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Apr 26, 2012 6:40 pm    Post subject:
Reply with quote

Bill,
you do realize i was being facetious (with reference to your obtuseness)


vasantha.gl,
how many groups of 11 in 8&9 are there, or can there be?
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Apr 26, 2012 10:02 pm    Post subject:
Reply with quote

vasantha.gl,

Use the following DFSORT JCL which will give you the desired results.

Code:

//STEP0100 EXEC PGM=SORT                                           
//SYSOUT   DD SYSOUT=*                                             
//SORTIN   DD *                                                   
----+----1----+----2----+----3----+----4----+----5----+----6----+--
AAAAAA10                                                           
BBBBBA10                                                           
BBBBBB10                                                           
BBBBBC11                                                           
DDDDDD11                                                           
DDDDDE11                                                           
AAAABB10                                                           
AAAABD10                                                           
AAAADD10                                                           
GGGGGG10                                                           
FFFFFF10                                                           
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *                                                   
  OPTION COPY                                                     
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(7,2,CH,EQ,C'11'),PUSH=(81:SEQ=8))
  OUTFIL BUILD=(1,80),INCLUDE=(81,8,ZD,GT,1,AND,7,2,CH,EQ,C'10')   
//*
Back to top
View user's profile Send private message
vasantha.gl

New User


Joined: 23 Sep 2011
Posts: 12
Location: Chennai

PostPosted: Fri Apr 27, 2012 11:47 am    Post subject: Reply to: Skip Initial records in a File
Reply with quote

Thanks, I got the expected result.
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 Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


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