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

Write OUTFILE by incrementing COUNT


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

New User


Joined: 03 Dec 2010
Posts: 87
Location: India

PostPosted: Thu Sep 11, 2014 3:43 pm
Reply with quote

I have two input files :-
1) Master file
Code:

HHH00285YYYYY    <---------- header record
TTT                       <--------- trailer record


2) Count File
Code:

455


I need a sort job that will read both these files as input and then update/create new MASTER file with new count in postion (4,5)
New count must be the count read from COUNT file + 1 ,
ie, in above example , my new MASTER file must be creted as below :
Code:

HHH00456YYYYY    <---------- header record with updated count 455+1=456
TTT                       <--------- trailer record


Thanks for all the help provided.
Back to top
View user's profile Send private message
techslam

New User


Joined: 03 Dec 2010
Posts: 87
Location: India

PostPosted: Fri Sep 12, 2014 11:49 am
Reply with quote

Is this not achievable through DFSORT ?
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Fri Sep 12, 2014 2:27 pm
Reply with quote

Ok but did you try something ?

I am pretty sure this forum has few examples

Based on the input you have provided

1.I assume your master file has two records and count file has 1 record
2.I would suggest a 2 step approach , 1 with SYMNAMES and the next with a basic sort with OVERLAY
Back to top
View user's profile Send private message
Gabriel Araujo Alves

New User


Joined: 20 Jul 2010
Posts: 38
Location: Brazil

PostPosted: Fri Sep 12, 2014 8:41 pm
Reply with quote

If you have a field in common in both files , you might use JoinKeys.
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: Sat Sep 13, 2014 3:17 pm
Reply with quote

JOINKEYS will work, whether or not there is a match existing in the data (one can always be made with JNFnCNTL).

However, Pandora's suggestion is much more efficient and would be the recommended way to do it. Examples here.
Back to top
View user's profile Send private message
techslam

New User


Joined: 03 Dec 2010
Posts: 87
Location: India

PostPosted: Sun Sep 14, 2014 2:10 am
Reply with quote

Thank you everyone.
below link helped me getting this requirement done.

http://ibmmainframes.com/about35147.html
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(F1 & F2) and writ... JCL & VSAM 4
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top