MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

reformatting o/p using SYNCSORT

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
yatri
Beginner


Joined: 23 Aug 2005
Posts: 12
Topics: 10

PostPosted: Tue Aug 23, 2005 11:27 pm    Post subject: reformatting o/p using SYNCSORT Reply with quote

hi,
I want to reformat output using syncsort, to remove leading zeros.
as of now my o/p file contains records as
Code:

ABCD 00057,00106,00000
EFGH  01061,00078,00001
PQRS 23467,01234,01234

I want o/p in the format
Code:

ABCD 57,106,0
EFGH 1061,78,1
PQRS 23467,1234,1234

is it possible to format the o/p the way I want it to be?
_________________
Thanks,
Gayatri.
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Wed Aug 24, 2005 12:29 am    Post subject: Reply with quote

Yatri,

I don't think you can left-align the numeric fields using Syncsort. But if you would like to suppress leading Zeroes and replace them with blanks, then you can use the following code.

Code:

//R010    EXEC  PGM=SORT
//SORTIN   DD  *
/*
//SORTOUT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  SORT FIELDS=COPY
  OUTREC FIELDS=(1,5,              *  Alpha portion  *
              6,5,ZD,EDIT=(IIIIT),    *  Suppress Zeroes *
             C',',
             12,5,ZD,EDIT=(IIIIT),
             C',',
             18,5,ZD,EDIT=(IIIIT))
/*


EDIT is a operator available in INREC/OUTREC to convert fields from one type to another. 'I' - Insignificant Digit (Similar to 'Z' in COBOL) and 'T' - Significant Digit (similar to '9' in COBOL).

Hope this helps,

Thanks,
Phantom
Back to top
View user's profile Send private message
yatri
Beginner


Joined: 23 Aug 2005
Posts: 12
Topics: 10

PostPosted: Wed Aug 24, 2005 4:16 am    Post subject: Reply with quote

Thanka a lot!!!
It did work.
_________________
Thanks,
Gayatri.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group