IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Skip Initial records in a File


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Apr 26, 2012 4:44 pm
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Apr 26, 2012 5:38 pm
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
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Apr 26, 2012 6:28 pm
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top