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

Justify option with some condition


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sunil kumar purohit

New User


Joined: 10 Sep 2009
Posts: 37
Location: bangalore

PostPosted: Mon Feb 22, 2010 6:28 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Feb 22, 2010 6:49 pm
Reply with quote

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
View user's profile Send private message
sunil kumar purohit

New User


Joined: 10 Sep 2009
Posts: 37
Location: bangalore

PostPosted: Mon Feb 22, 2010 7:03 pm
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Feb 22, 2010 9:50 pm
Reply with quote

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
View user's profile Send private message
sunil kumar purohit

New User


Joined: 10 Sep 2009
Posts: 37
Location: bangalore

PostPosted: Tue Feb 23, 2010 9:41 am
Reply with quote

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))) 


icon_biggrin.gif
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Tue Feb 23, 2010 9:44 am
Reply with quote

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 icon_smile.gif
Back to top
View user's profile Send private message
sunil kumar purohit

New User


Joined: 10 Sep 2009
Posts: 37
Location: bangalore

PostPosted: Tue Feb 23, 2010 9:46 am
Reply with quote

Ok..
Thanx for information.
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 SCOPE PENDING option -check data DB2 2
No new posts OUTFIL with SAVE option DFSORT/ICETOOL 7
No new posts CICS vs LE: STORAGE option CICS 0
No new posts INSYNC option with same function as I... JCL & VSAM 0
No new posts Option DYNALLOC second parameter. DFSORT/ICETOOL 11
Search our Forums:

Back to Top