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
 

 

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 DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm
No new posts Sort two file having same field, one ... himanshu malik DFSORT/ICETOOL 7 Thu Feb 02, 2017 10:09 am
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 7 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am


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