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
 
How to insert ZEROES by SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
ankvardhan

New User


Joined: 05 Sep 2008
Posts: 14
Location: Mumbai

PostPosted: Fri Feb 27, 2009 1:03 pm    Post subject: How to insert ZEROES by SORT
Reply with quote

Hi,
I need to replace the starting 10 bytes of my file with Zeroes, how can i do the same.

eg: file format :
999999999999
888888888888
777777777777

O/P required :
0000000099999
0000000088888
0000000077777

Hope for the positive reply.
Thanks,
Ank
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Feb 27, 2009 1:55 pm    Post subject:
Reply with quote

Usual questions

RECFM, LRECL
Back to top
View user's profile Send private message
ankvardhan

New User


Joined: 05 Sep 2008
Posts: 14
Location: Mumbai

PostPosted: Fri Feb 27, 2009 2:40 pm    Post subject: Reply to: How to insert ZEROES by SORT
Reply with quote

Expat, i couldn't get you from Rec Format and its length.
only i need to replace the starting 10 bytes from ZEROES.

SORT FIELDS=(1,10,CH,A)
OUTREC FIELDS=(1:1,10,123X)

i used the above defined sortcard, but it gives an spaces.
can you help me out how to define zeroes.

Thanks,
Ank
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Feb 27, 2009 3:18 pm    Post subject:
Reply with quote

Hi,

you say you want to replace the first 10 bytes with zeroes, but your output shows only 8 zeroes.

Anyway, this will replace the 10 first bytes
Code:
OUTREC  OVERLAY=(1:C'0000000000')



Gerry
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Feb 27, 2009 3:22 pm    Post subject: Re: Reply to: How to insert ZEROES by SORT
Reply with quote

ankvardhan wrote:
Expat, i couldn't get you from Rec Format and its length.

What is the RECFM and LRECL of the input dataset.
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: Fri Feb 27, 2009 9:47 pm    Post subject:
Reply with quote

Quote:
123X - i used the above defined sortcard, but it gives an spaces.
can you help me out how to define zeroes.


You can use C'0' for a character zero or nC'0' for n character zeros.

If you want to overlay the first 10 bytes with character zeros, you can use:

Code:

    OPTION COPY
    OUTREC OVERLAY=(1:10C'0')


You can use a SORT statement instead of OPTION COPY if appropriate.

If that's not what you want to do, then you need to explain more clearly what you want to do with a good example of your input records and what you expect for output.
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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts How to insert a value on specific pos... Poha Eater DFSORT/ICETOOL 9 Sun Oct 01, 2017 3:04 am
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm

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