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

Way to left justify an Alpha numeric fields


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Fri Feb 20, 2009 4:09 am
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 Developer


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

PostPosted: Fri Feb 20, 2009 5:00 am
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
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 Developer


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

PostPosted: Fri Feb 20, 2009 5:19 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
No new posts Convert HEX to Numeric DB2 3
No new posts Find a record count/numeric is multip... COBOL Programming 1
No new posts Concatenate 2 fields (usage national)... COBOL Programming 2
No new posts Cobol COMP-2 fields getting scrambled... Java & MQSeries 6
Search our Forums:

Back to Top