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
 
Way to left justify an Alpha numeric fields

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

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Fri Feb 20, 2009 4:01 am    Post subject: Way to left justify an Alpha numeric fields
Reply with quote

Hi,

I searched the forum for checking if there is a way to left justify an Alpha numeric fields..But couldnt find it.

The requirement is, I have got two fields ( as shown below )

Code:

A     | B
023000|       1123
023000|       1123
023000|       1123
023000|       1123
023000|       1123
023000|       1123
023000|       1123
023000|       1123
023000|       1123
023000|       1123
023000|       1123
050680|     AAA021
045873|       1123
045873|       1123
045873|       2507
045873|       2507
045873|       2507
"Code"d for readability

I need to sort them based on Column A and also left justify Column B.

Any help is appreciated.

Thks
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Feb 20, 2009 4:09 am    Post subject:
Reply with quote

Hello,

It will probably help if you show how the output should be created.

Also, the "Code" tag will preserve alignment. . .
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 20, 2009 5:00 am    Post subject:
Reply with quote

ap,

If I understand what you want, you can use a DFSORT job like the following:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
023000|       1123
023000|       1123
023000|       1123
023000|       1123
023000|       1123
023000|       1123
023000|       1123
023000|       1123
023000|       1123
023000|       1123
023000|       1123
050680|     AAA021
045873|       1123
045873|       1123
045873|       2507
045873|       2507
045873|       2507
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  SORT FIELDS=(1,6,CH,A)
  OUTREC OVERLAY=(8:8,11,JFY=(SHIFT=LEFT))
/*


SORTOUT will have:

Code:

023000|1123         
023000|1123         
023000|1123         
023000|1123         
023000|1123         
023000|1123         
023000|1123         
023000|1123         
023000|1123         
023000|1123         
023000|1123         
045873|1123         
045873|1123         
045873|2507         
045873|2507         
045873|2507         
050680|AAA021       


If that's not what you want, then show the output you do want.
Back to top
View user's profile Send private message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Fri Feb 20, 2009 5:01 am    Post subject:
Reply with quote

hello,

For the Input data is as shown below:

Code:
B     |        A    |
023000|       1310  |
023000|       1310  |
050680|     PSA021  |
045873|       2507  |
045873|       2507  |


The output I am expecting is

Code:
B     |     A     |   
023000|1310       |
023000|1310       |
045873|2507       |
045873|2507       |
050680|PSA021     


As the output shows, the requirements are
1. Sort data based on Column B.
2. Header should be there ( Like B and A) , and should not be sorted
3. Left justify the column B data.

Please advise.
Thanks,
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 20, 2009 5:19 am    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD *
B     |        A    |
023000|       1310  |
023000|       1310  |
050680|     PSA021  |
045873|       2507  |
045873|       2507  |
/*
//OUT DD SYSOUT=*
//TOOLIN   DD    *
DATASORT FROM(IN) TO(OUT) HEADER USING(CTL1)
//CTL1CNTL DD *
  INREC OVERLAY=(8:8,13,JFY=(SHIFT=LEFT))
  SORT FIELDS=(1,6,CH,A)
/*
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 Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm

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