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
 

 

Right justifying and adjusting numeric fields

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

New User


Joined: 04 Jun 2007
Posts: 25
Location: Pune

PostPosted: Tue Feb 10, 2009 8:00 pm    Post subject: Right justifying and adjusting numeric fields
Reply with quote

Hi Frank,

I have a flat file, 75 bytes in length.
The file contains 5 fields each 15 bytes in length, the first, third and fourth fields contain numeric values whereas the second and third contain alphabetic values. Each field is left justified with padded spaces in case the value of that field is less than the whole 15 bytes.
Following is a sample record:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+
1111111111 aaaaaaaaa bbbbb 22222 12345678

My requirement is right justify the numeric fields with leading zeroes and retain the alphabetic fields as they are.

I want my output formatted in the following way:

000001111111111aaaaaaaaa bbbbb 000000000022222000000012345678

Thanks!
R
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 Feb 10, 2009 10:16 pm    Post subject:
Reply with quote

You can use a DFSORT job like the following to do what you asked for:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
1111111111     aaaaaaaaa      bbbbb          22222            12345678
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INREC OVERLAY=(1:1,15,UFF,M11,LENGTH=15,
    46:46,15,UFF,M11,LENGTH=15,
    61:61,15,UFF,M11,LENGTH=15)
/*
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Tue Feb 10, 2009 11:05 pm    Post subject:
Reply with quote

Rashmi,
Did your shop trade in Syncsort for DFSORT?
Back to top
View user's profile Send private message
rashmi123

New User


Joined: 04 Jun 2007
Posts: 25
Location: Pune

PostPosted: Tue Feb 10, 2009 11:15 pm    Post subject: Reply to: Right justifying and adjusting numeric fields
Reply with quote

THanks Frank!
And ya no such luck...we still have Syncsort was just wondering how it can be done using DFSort

Thanks!
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Tue Feb 10, 2009 11:21 pm    Post subject: Re: Reply to: Right justifying and adjusting numeric fields
Reply with quote

rashmi123 wrote:
we still have Syncsort was just wondering how it can be done using DFSort
Does it have OVERLAY?
Back to top
View user's profile Send private message
rashmi123

New User


Joined: 04 Jun 2007
Posts: 25
Location: Pune

PostPosted: Tue Feb 10, 2009 11:27 pm    Post subject: Reply to: Right justifying and adjusting numeric fields
Reply with quote

Thankfully it does...and it works too!!!
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 How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Validate if a Value from the file is ... balacsv2 COBOL Programming 8 Mon Jun 19, 2017 11:52 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Sum Fields ballaswaroop DFSORT/ICETOOL 4 Tue May 02, 2017 11:07 am
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm


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