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

Select and reformat


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

New User


Joined: 30 Apr 2005
Posts: 2
Location: Bangalore

PostPosted: Tue Jun 28, 2005 12:45 pm
Reply with quote

I need to format an input file which is of variable length such that for suppose the input file contains data for many country with the file format as below:
Input file:
First three(3) columns/bytes contain Country Number, like 788,678, etc
and the next eight(8) columns/bytes contains Customer Number, f.e 00123456, 99234567, 12345678 etc

Now my question is,, I want to format this input file in such a way that I want to select Country Number '788' and for this country number see if there are any customers whose customer number starts with '99' like 99234567 and replace this first two column/bytes having '99' with '00', while doing I should not format customer numbers for others countries and the OutPut file should contain data for ALL countries and not just for country '788' alone.

Any help is much appreciated. Thank you
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: Tue Jun 28, 2005 9:59 pm
Reply with quote

Please show a good example of your input records with relevent values and what you want the output records to look like.

Also, what is the LRECL of your input file?

Do all of the records contain all of the fields or are there "short records" which are missing some of the fields?
Back to top
View user's profile Send private message
Hritam

New User


Joined: 27 Jun 2005
Posts: 36
Location: India

PostPosted: Wed Jun 29, 2005 4:01 pm
Reply with quote

Hi sreedhar,

You can use the following sort card to solve you issue:
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,4,5:5,5,CHANGE=(5,C'78899',C'78800'),
NOMATCH=(5,5),10)
//*

This will check for 78899 records & then replace it by 78800(as far your requirement) Rest of the records it will keep as it is.
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 Dynamically pass table name to a sele... DB2 2
No new posts How to Reformat a file using File Man... All Other Mainframe Topics 14
No new posts SELECT from data change table DB2 5
No new posts Select two different counts from SQL... DB2 6
No new posts Reformat and relocate content DFSORT/ICETOOL 4
Search our Forums:

Back to Top