Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ 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
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 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
No new posts Select first 2 group data vice_versa DFSORT/ICETOOL 10 Mon Jun 13, 2016 2:21 pm
No new posts Query to select Null row on priority RahulG31 DB2 24 Thu Jan 21, 2016 5:45 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us