Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Select and reformat

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
Author Message
SreedharNarala

New User


Joined: 30 Apr 2005
Posts: 2
Location: Bangalore

PostPosted: Tue Jun 28, 2005 12:45 pm    Post subject: Select and reformat
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
References
Frank Yaeger

DFSORT Moderator


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

PostPosted: Tue Jun 28, 2005 9:59 pm    Post subject:
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: 32
Location: India

PostPosted: Wed Jun 29, 2005 4:01 pm    Post subject:
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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1