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

How to insert ZEROES by SORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 8797
Location: Welsh Wales

PostPosted: Fri Feb 27, 2009 1:55 pm
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
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: 1702
Location: Australia

PostPosted: Fri Feb 27, 2009 3:18 pm
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: 8797
Location: Welsh Wales

PostPosted: Fri Feb 27, 2009 3:22 pm
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 Developer


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

PostPosted: Fri Feb 27, 2009 9:47 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top