|
View previous topic :: View next topic
|
| Author |
Message |
aishvarya_82
New User

Joined: 11 Nov 2008 Posts: 11 Location: Pune
|
|
|
|
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 |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
 |
Escapa
Senior Member

Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
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 |
|
 |
aishvarya_82
New User

Joined: 11 Nov 2008 Posts: 11 Location: Pune
|
|
|
|
| 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 |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
| Be aware that you have only put one space to be overlayed. |
|
| Back to top |
|
 |
Escapa
Senior Member

Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
| 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 |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
That is funny :-)
Thanks. |
|
| Back to top |
|
 |
aishvarya_82
New User

Joined: 11 Nov 2008 Posts: 11 Location: Pune
|
|
|
|
| Thanks a lot .It worked like a champ...in a single go. |
|
| Back to top |
|
 |
THINKSRINIII Warnings : 1 New User
.jpg)
Joined: 09 Jan 2009 Posts: 88 Location: India
|
|
|
|
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?  |
|
| Back to top |
|
 |
kratos86
Active User

Joined: 17 Mar 2008 Posts: 148 Location: Anna NGR
|
|
|
|
| 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 |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
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 |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|