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

Can we do right justified using Sort


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


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

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

Thanks Frank!!
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 May 05, 2006 11:49 pm
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:

Use [URL] BBCode for External Links


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
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
Reply with quote

post ur SYSOUT messages here
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: Wed May 14, 2008 8:35 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top