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

Adding IFTHEN condition to existing sort card


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

New User


Joined: 11 Nov 2008
Posts: 11
Location: Pune

PostPosted: Wed Aug 24, 2011 3:11 pm
Reply with quote

Hi,

I have an existing sort card like below :

Code:
OPTION COPY                                                         
INREC OVERLAY=(371:174,4,ZD,ADD,+1,EDIT=(TTTT),375:170,2,377:172,2)
OUTFIL OMIT=(371,8,CH,LT,DATE1,           
    AND,160,02,CH,NE,C'00',                               
    AND,160,02,CH,NE,C'11',                               
    AND,160,02,CH,NE,C'14',                               
    AND,160,02,CH,NE,C'15',                               
    AND,160,02,CH,NE,C'16'),                               
  BUILD=(1,370) 



I need to add following condition to the above sort card:

INREC IFTHEN=(WHEN=(60,9,CH,EQ,C'000000000'),OVERLAY=(60:C' ')) .

I tried by giving this new condition aftre INREC OVERLAY and removing my INREC keyword (as I think only one INREC can be given at a time ).it is not giving error but also not formatting the records as I want .

Do i need to use some keyword like HIT NEXT ? for continuation.

Kindly suggest.

Thanks,
Aishvarya
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Aug 24, 2011 3:15 pm
Reply with quote

Please use the "code" tags for your sort cards, it preserves the spacing.

I don't know that we can answer your question without having an idea of what you want to do.

So,

Some sample input, sample output (both nicely "Code"d, recfms/lrecls and a description of what you are trying to achieve.
Back to top
View user's profile Send private message
Escapa

Senior Member


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

PostPosted: Wed Aug 24, 2011 3:20 pm
Reply with quote

Use below...
Code:

//SYSIN    DD *                                                         
 OPTION COPY                                           
 INREC IFTHEN=(WHEN=INIT,                                               
       OVERLAY=(371:174,4,ZD,ADD,+1,EDIT=(TTTT),375:170,2,377:172,2)), 
       IFTHEN=(WHEN=(60,9,CH,EQ,C'000000000'),                         
       OVERLAY=(60:C'         '))                                               
  OUTFIL OMIT=(371,8,CH,LT,DATE1,                                       
  AND,160,02,CH,NE,C'00',                                               
  AND,160,02,CH,NE,C'11',                                               
  AND,160,02,CH,NE,C'14',                                               
  AND,160,02,CH,NE,C'15',                                               
  AND,160,02,CH,NE,C'16'),                                             
  BUILD=(1,370)                                                         
/*                                                                     


Also you could have omitted records which are not having 00\11\14\15\16 at 160,2 before INREC is applied itself using OMIT COND
Back to top
View user's profile Send private message
aishvarya_82

New User


Joined: 11 Nov 2008
Posts: 11
Location: Pune

PostPosted: Wed Aug 24, 2011 3:23 pm
Reply with quote

We have some records with zeroes in columns 60-68 and I want to convert them into spaces by adding the condition in existing sort card.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Aug 24, 2011 3:25 pm
Reply with quote

Be aware that you have only put one space to be overlayed.
Back to top
View user's profile Send private message
Escapa

Senior Member


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

PostPosted: Wed Aug 24, 2011 3:27 pm
Reply with quote

Bill Woodger wrote:
Be aware that you have only put one space to be overlayed.

Yeah Bill.. Thats because he did not use code tag ... it got squeezed...
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Aug 24, 2011 3:43 pm
Reply with quote

That is funny :-)

Thanks.
Back to top
View user's profile Send private message
aishvarya_82

New User


Joined: 11 Nov 2008
Posts: 11
Location: Pune

PostPosted: Wed Aug 24, 2011 4:03 pm
Reply with quote

Thanks a lot .It worked like a champ...in a single go.
Back to top
View user's profile Send private message
THINKSRINIII
Warnings : 1

New User


Joined: 09 Jan 2009
Posts: 88
Location: India

PostPosted: Wed Aug 24, 2011 4:18 pm
Reply with quote

Sambhaji,

Is there any advantage in using the OMIT condition first than using that in OUTFIL ?
I suppose since the number of records that would be processed is reduced it might increase the performance.
Am I right? icon_question.gif
Back to top
View user's profile Send private message
kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Wed Aug 24, 2011 4:58 pm
Reply with quote

Quote:
I suppose since the number of records that would be processed is reduced it might increase the performance.
Am I right?

Yes
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Aug 24, 2011 11:22 pm
Reply with quote

aishvarya_82,

Quote:
INREC OVERLAY=(371:174,4,ZD,ADD,+1,EDIT=(TTTT),375:170,2,377:172,2)


Do you realize that you are creating an invalid date in pos 371 if the date happens to Feb 29th of a leap year when you just add 1 to the year portion without validating the month and date?

For example if you are running on 2013-FEB-28 and if your input has the following date

2012-02-29 now adding 1 to the year makes the date as 2013-02-29 and your omit condition would fail. I am showing the filtering and INREC manipulation as I am not really sure what the date check is. If you explain your date check condition, I will suggest an alternate solution. I think your date check is similar to another topic here where I provided a solution.

ibmmainframes.com/viewtopic.php?t=55811

I would suggest filtering the data before instead of doing it on OUTFIL and use positive conditions instead of negative conditions.

Code:

//SYSIN  DD *
  INCLUDE COND=(160,2,SS,EQ,C'00,11,14,15,16')
  INREC IFTHEN=(WHEN=(60,9,ZD,EQ,0),OVERLAY=(60:9C' '))
//*
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 Adding QMF and SPUFI to the ISPF menu DB2 20
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top