Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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
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    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

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
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: 36
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Can we limit length in concatenation ... balaji81_k DB2 7 Tue Aug 22, 2017 2:50 am
No new posts Select numeric portion from CHAR data... balaji81_k DB2 6 Sat Aug 19, 2017 1:51 am
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts Two Selects in a single select query Rohit Umarjikar DB2 1 Fri Nov 04, 2016 8:46 pm
No new posts OUTREC FILELDS FAILS WITH ICE126A 2 ... balaji81_k DFSORT/ICETOOL 8 Sat Jul 02, 2016 1:22 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us