|
|
| Author |
Message |
Hritam
New User
Joined: 27 Jun 2005 Posts: 29 Location: India
|
|
|
|
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 |
|
 |
References
|
Posted: Tue Aug 09, 2005 6:50 pm Post subject: Re: Can we do right justified using Sort |
 |
|
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 3900 Location: San Jose, CA
|
|
|
|
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 |
|
 |
Hritam
New User
Joined: 27 Jun 2005 Posts: 29 Location: India
|
|
|
|
| Thanks Frank!! |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 3900 Location: San Jose, CA
|
|
|
|
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 |
|
 |
mohitsaini
New User
Joined: 15 May 2006 Posts: 40
|
|
|
|
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 |
|
 |
krisprems
Senior Member
Joined: 27 Nov 2006 Posts: 617 Location: India
|
|
|
|
| post ur SYSOUT messages here |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 6728 Location: 221 B Baker St
|
|
|
|
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 It just wastes everyone's time. . .
When you post a problem, you need to provide details about the problem. |
|
| Back to top |
|
 |
|
|
|