View previous topic :: View next topic
|
Author |
Message |
sunil kumar purohit
New User
Joined: 10 Sep 2009 Posts: 37 Location: bangalore
|
|
|
|
I have to justify some record to left if some criteria is meet.
For example, if column 1-10 is space for any record. Move it's content to left.
How can i achieve this?
I know we can use DFSORT and JFY keyword.
But i want justify action only when certain criteria is met.
Please suggest.
Thanx in advance. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Quote: |
But i want justify action only when certain criteria is met. |
Unless you tell us exactly what criteria, how do you expect us to be able to help.
Are we to assume that DFSORT can not be used for this requirement as you have stated that it can be done using DFSORT. If so, which product do you suggest is used in its place.
If DFSORT can be used please specify the RECFM and LRECL of the input file. Explain the rules for getting from the input to the output. Show examples of both input and output records.
Have you tried using DFSORT and JFY.
What problems did you have. |
|
Back to top |
|
|
sunil kumar purohit
New User
Joined: 10 Sep 2009 Posts: 37 Location: bangalore
|
|
|
|
Input Records
Code: |
"CHECK"
FINAL112 214 016
FINAL112 362 023
FINAL214 209 016
GSCI200 704 //*
GSCI200C 704 //*
GSCI300 518 //*
GSC6100 610 //*
LISTJOB 13 SRC
MSG823 10 %
"REPORT"
BKCPAN08 116 IM
BKCPAN08 174 IM |
Expected O/P
Code: |
"CHECK"
FINAL112 214 016
FINAL112 362 023
FINAL214 209 016
GSCI200 704 //*
GSCI200C 704 //*
GSCI300 518 //*
GSC6100 610 //*
LISTJOB 13 SRC
MSG823 10 %
"REPORT"
BKCPAN08 116 IM
BKCPAN08 174 IM |
I am using this code in JCL, In which i need to mention the condition If any records contain spaces in first 5 column, shift it to left.
Code: |
//SYSIN DD *
OPTION COPY
INREC FIELDS=(1,25,SQZ=(SHIFT=LEFT))
|
Current O/p
Code: |
"CHECK"
FINAL112214016494
FINAL112362023010
FINAL214209016411
GSCI200704//*
GSCI200C704//*
GSCI300518//*
GSC6100610//*
LISTJOB13SRCHFO
MSG82310%
"REPORT"
BKCPAN08116IMPQF
BKCPAN08174IMPQF |
[/code] |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Hi Sunil,
Use below sort card to get desired output.
Code: |
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(1,5,CH,EQ,C' '),BUILD=(1,25,SQZ=(SHIFT=LEFT)))
/*
|
Output will be
Code: |
"CHECK"
FINAL112 214 016
FINAL112 362 023
FINAL214 209 016
GSCI200 704 //*
GSCI200C 704 //*
GSCI300 518 //*
GSC6100 610 //*
LISTJOB 13 SRC
MSG823 10 %
"REPORT"
BKCPAN08 116 IM
BKCPAN08 174 IM
|
|
|
Back to top |
|
|
sunil kumar purohit
New User
Joined: 10 Sep 2009 Posts: 37 Location: bangalore
|
|
|
|
Thanx a lot to all...
Sorting is not required for me so i use this code
Code: |
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(1,5,CH,EQ,C' '),
BUILD=(1,25,SQZ=(SHIFT=LEFT)))
|
|
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Quote: |
Sorting is not required for me so i use this code |
SORT FIELDS=COPY does not sort, so ur code and Sambhaji's code are the same |
|
Back to top |
|
|
sunil kumar purohit
New User
Joined: 10 Sep 2009 Posts: 37 Location: bangalore
|
|
|
|
Ok..
Thanx for information. |
|
Back to top |
|
|
|