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

Is it possible using DFSORT


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

New User


Joined: 10 Dec 2012
Posts: 37
Location: India

PostPosted: Wed Aug 28, 2013 12:16 pm
Reply with quote

Hello All,

I have a requirement in my project and would like to know if it is possible using DFSORT.

I have a file as shown below - 80 rec len. H-header, T-trailer, 9-data. The file contains header-trailer groups with detail records in between. eg.
H
T
H
9
T
H
9
9
T
H
9
T

I need to spilt this file into two. The threshold value is 7. It means that the first file should contain the records with record count less than 7 and also only upto the latest HT group. ie if the seventh record is either H or 9, then only records upto the latest T should be present in the first file and the remaining should be pushed to file2.

I have written a SELCOPY program to achieve this. But just wanted to know if it can be done using DFSORT.

Output should be
File 1
H
T
H
9
T

File 2
H
9
9
T
H
9
T
Back to top
View user's profile Send private message
Musab Ahmed

New User


Joined: 10 Dec 2012
Posts: 37
Location: India

PostPosted: Wed Aug 28, 2013 4:30 pm
Reply with quote

Since there are no replies,

I guess this is not possible.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Aug 28, 2013 4:49 pm
Reply with quote

It is less that four and a quarter hours since you originally posted and yet you decry the lack of response so quickly.

People that respond do so in THEIR time, not yours. They also respond for FREE

Also remember that a lot of the respondants live in a different time zone than you do.
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 Aug 28, 2013 5:14 pm
Reply with quote

http://ibmmainframes.com/viewtopic.php?p=311372#311372
Back to top
View user's profile Send private message
Musab Ahmed

New User


Joined: 10 Dec 2012
Posts: 37
Location: India

PostPosted: Wed Aug 28, 2013 10:04 pm
Reply with quote

i didnt mean to be rude..
dont get so sensitive expat.
bad to your health.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Thu Aug 29, 2013 8:04 am
Reply with quote

If you've seen as many "impatient" posts as some of the rest of us over the years, you might well have responded in the same manner as expat. icon_smile.gif
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue Sep 03, 2013 10:33 pm
Reply with quote

Musab Ahmed wrote:
Since there are no replies,

I guess this is not possible.


As others already mentioned, not every one works in your time zone or round the clock without vacation.

Yes it is quite simple task for DFSORT if you follow the steps listed below

1. Using INREC IFTHEN=(WHEN=INIT, overlay a 8 byte sequence number at position 81.

2. On the same Inrec use IFTHEN=(WHEN=GROUP, and check for seqnum=7 and the 1st byte as either "H" or "9" as BEGIN parms and check for "T" on the END parm and PUSH the sequence at 81 onto position 81. By doing so you have set the keys to be split.

3. Using OUTFIL INCLUDE with sequence number at 81 LE 7 write them file1 and BUILD just the 80 bytes. For File2 you can use SAVE parm on outfil to write out the rest of the records.
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 Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
No new posts DFSORT - VB file RDW getting overridden DFSORT/ICETOOL 3
Search our Forums:

Back to Top