Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
ap_mainframes

Active User

Joined: 29 Dec 2005
Posts: 181

Posted: Fri Feb 20, 2009 4:01 am    Post subject: Way to left justify an Alpha numeric fields

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

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

Any help is appreciated.

Thks

dick scherrer

Site Director

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

 Posted: Fri Feb 20, 2009 4:09 am    Post subject: Hello, It will probably help if you show how the output should be created. Also, the "Code" tag will preserve alignment. . .
Frank Yaeger

DFSORT Moderator

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

Posted: Fri Feb 20, 2009 5:00 am    Post subject:

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.
ap_mainframes

Active User

Joined: 29 Dec 2005
Posts: 181

Posted: Fri Feb 20, 2009 5:01 am    Post subject:

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.

Thanks,
Frank Yaeger

DFSORT Moderator

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

Posted: Fri Feb 20, 2009 5:19 am    Post subject:

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) /*
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us