Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Adding IFTHEN condition to existing sort card

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Adding IFTHEN condition to existing sort card
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Wed Aug 24, 2011 3:15 pm    Post subject: Reply to: Adding IFTHEN condition to existing sort card
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    Post subject:
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Wed Aug 24, 2011 3:25 pm    Post subject: Reply to: Adding IFTHEN condition to existing sort card
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    Post subject: Re: Reply to: Adding IFTHEN condition to existing sort card
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Wed Aug 24, 2011 3:43 pm    Post subject: Reply to: Adding IFTHEN condition to existing sort card
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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.

http://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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us