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

Sort a file excluding page headers ?


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Bill Woodger

Moderator Emeritus


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

PostPosted: Wed Jun 15, 2011 8:32 pm
Reply with quote

sqlcode,

I've been trying to make this easy to do :-)

Why don't you like "identify the data lines/leave everything else alone"? Positions, content, artistic style of everything except the data lines becomes irrelevant. Copy 'em out. Sort 'em. Stick 'em back where a data-line was originally.

I've even been thinking I could code it, using enrico's duplicate-matching code.

Don't worry, only thinking.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Wed Jun 15, 2011 8:50 pm
Reply with quote

Bill Woodger,
The logic here in the code I gave, identifies HEADER records and populate sort key values in such a way so that HEADER records are kept together and at the top for every group starting with given HEADER conditions.

Sure, we may approach "identify the data lines/leave everything else alone", but unless, I am missing some of OP's remarks here, I don't see a way to identify "detail" records.

One way to achieve the same would be to use below conditions,which checks for "NUM"erics on 25th position,but I am not sure if that will suffice OP's requirement. This would fail if one of the header conditions has numbers at 25th position.
Code:
//SYSIN    DD *                                             
   INREC IFTHEN=(WHEN=GROUP,BEGIN=(40,07,CH,EQ,C'WELCOME'),
                            PUSH=(301:ID=8)),               
         IFTHEN=(WHEN=INIT,OVERLAY=(309:25,8)),             
         IFTHEN=(WHEN=(25,8,FS,NE,NUM),OVERLAY=(309:8C'0'))
   SORT FIELDS=(301,8,ZD,A,309,8,ZD,A),EQUALS               
   OUTFIL BUILD=(1,300)                                     
//*                                                         

Thanks,
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: Wed Jun 15, 2011 8:59 pm
Reply with quote

sqlcode, you are right. Didn't get an answer to "reliably identify" and still no actual example of the data.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Wed Jun 15, 2011 9:10 pm
Reply with quote

I think the issue may have been resolved earlier if there had been sample output to go with the sample input - then we could have seen if data lines changed pages or not - there could be a lot of language problem here.

One of the replies from OP suggests that the data lines should be extracted, sorted and headers re-inserted every 80 lines (page of A4?) except the every 80 lines was line 80, 180 etc (but that could have been a typo and should have been 80, 160,240 etc.)
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 Jun 16, 2011 5:44 pm
Reply with quote

seahawk789, anything for sqlcode1 on this one, before you move on to the next?
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 Jun 16, 2011 8:14 pm
Reply with quote

Dick, tried to get some thanks from seahawk789 for sqlcode1 by posting here. Didn't work. Sqlcode1 probably won't get thanks for the new work.

Maybe sqlcode1 doesn't mind, but it is a bit much from TS/OP. Ooer, I came over all MFSB.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Jun 16, 2011 11:11 pm
Reply with quote

On a muddled question like this where knowing what the input looks like and the rules for obtaining the output is really important, I would not continue the discussion until the OP posted the needed information. I would suggest you guys do the same and not continue posting guesses with no real information to go on.
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 Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
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