View previous topic :: View next topic
|
Author |
Message |
ap_mainframes
Active User
Joined: 29 Dec 2005 Posts: 181 Location: Canada
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
It will probably help if you show how the output should be created.
Also, the "Code" tag will preserve alignment. . . |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
ap_mainframes
Active User
Joined: 29 Dec 2005 Posts: 181 Location: Canada
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
|