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
 
Can we do right justified using Sort

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

New User


Joined: 27 Jun 2005
Posts: 36
Location: India

PostPosted: Tue Aug 09, 2005 6:50 pm    Post subject: Can we do right justified using Sort
Reply with quote

Hi,
I have a requirement for which i have to do right justified.
e.g
I have a field say NAME of Field length 10 as charachter
which having the data content
Code:

  "XXXXXX    " 
  "YYY       "
  "RRRRRRR   "

now i want the O/P file having that field as
Code:

  "    XXXXXX" 
  "       YYY"
  "   RRRRRRR"


Can you do this kind of indentation using SYNCSORT/ DFSORT.

Thanks,

Hritam
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: Tue Aug 09, 2005 9:42 pm    Post subject:
Reply with quote

You can do this with the following DFSORT job using the new IFTHEN feature available with z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004). Syncsort does NOT support IFTHEN, so you can't use this job with Syncsort.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
XXXXXX
YYY
RRRRRRR
A
BB
CCC
DDDD
EEEEE
FFFFFF
GGGGGGG
HHHHHHH
JJJJJJJJJJ
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=(2,9,CH,EQ,C' '),BUILD=(10:1,1)),
        IFTHEN=(WHEN=(3,8,CH,EQ,C' '),BUILD=(9:1,2)),
        IFTHEN=(WHEN=(4,7,CH,EQ,C' '),BUILD=(8:1,3)),
        IFTHEN=(WHEN=(5,6,CH,EQ,C' '),BUILD=(7:1,4)),
        IFTHEN=(WHEN=(6,5,CH,EQ,C' '),BUILD=(6:1,5)),
        IFTHEN=(WHEN=(7,4,CH,EQ,C' '),BUILD=(5:1,6)),
        IFTHEN=(WHEN=(8,3,CH,EQ,C' '),BUILD=(4:1,7)),
        IFTHEN=(WHEN=(9,2,CH,EQ,C' '),BUILD=(3:1,8)),
        IFTHEN=(WHEN=(10,1,CH,EQ,C' '),BUILD=(2:1,9))
/*


SORTOUT will have:

Code:


    XXXXXX
       YYY
   RRRRRRR
         A
        BB
       CCC
      DDDD
     EEEEE
    FFFFFF
   GGGGGGG
  HHHHHHHH
JJJJJJJJJJ
Back to top
View user's profile Send private message
Hritam

New User


Joined: 27 Jun 2005
Posts: 36
Location: India

PostPosted: Thu Aug 11, 2005 8:56 am    Post subject:
Reply with quote

Thanks Frank!!
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 May 05, 2006 11:49 pm    Post subject:
Reply with quote

You can now do this much more easily with the new JFY function available with z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) as shown by the DFSORT job below. For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTFs, see:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/


Code:

//S1 EXEC PGM=SORT
//SYSOUT    DD SYSOUT=*
//SORTIN  DD *
XXXXXX
YYY
RRRRRRR
A
BB
CCC
DDDD
EEEEE
FFFFFF
GGGGGGG
HHHHHHH
JJJJJJJJJJ
//SORTOUT DD SYSOUT=*
//SYSIN    DD  *
  OPTION COPY
  INREC BUILD=(1,10,JFY=(SHIFT=RIGHT))
/*
Back to top
View user's profile Send private message
mohitsaini
Warnings : 1

New User


Joined: 15 May 2006
Posts: 92

PostPosted: Wed May 14, 2008 5:21 pm    Post subject:
Reply with quote

Hi there,

If I try the JCLs mentioned above then they are working alright. However if I give a Dataset for my SORTIN then I am getting errors. I am sure that I am missing on a very small thing. Donno what ??????

This JCL that I am using is:

//TSUBURGJ JOB (METR5355),'MOHITS',NOTIFY=TSUBURG,
// CLASS=A,MSGCLASS=H,PRTY=8,MSGLEVEL=(1,1)
/*JOBPARM S=ANY,FORMS=STD
//S1 EXEC PGM=DFSORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=TSUBURG.NDC.CODES,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC BUILD=(1,10,JFY=(SHIFT=RIGHT))
/*

The only difference between this JCL and the one mentioned above (by Frank) is that here I am using a dataset instead for SORTIN.

Please let me know if this is unclear to you or if you need more information.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Wed May 14, 2008 5:25 pm    Post subject:
Reply with quote

post ur SYSOUT messages here
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: Wed May 14, 2008 8:35 pm    Post subject:
Reply with quote

Hello,

Quote:
However if I give a Dataset for my SORTIN then I am getting errors. I am sure that I am missing on a very small thing
It does you no good to post "it didn't work" or some variation of that icon_sad.gif It just wastes everyone's time. . .

When you post a problem, you need to provide details about the problem.
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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm

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