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

DF SORT with OVERLAY & INCLUDE OPTION


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

New User


Joined: 23 Dec 2008
Posts: 69
Location: India

PostPosted: Thu Jun 24, 2010 2:10 pm
Reply with quote

HI,

This is the problem i have in SORT. I have two conditions to be checked but i need to use a single sort card.

"IF 5,2,CH,EQ,C'95' and position 37 = J or K or L or M or N or O or P or Q or R or } THEN move } to position 62"

"IF 5,2,CH,EQ,C'97' then overwrite the position 37 and 62 with '}'."
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Jun 24, 2010 2:15 pm
Reply with quote

sijayapal wrote:
This is the problem i have in SORT. I have two conditions to be checked but i need to use a single sort card.
What do you mean by a single sort card. Do you mean one single card on one single line, or one set of statements that can span several lines.

Do you use DFSORT or SYNCSORT. Please post the output from
Code:
//SORTSTEP EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
ABC
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  SORT     FIELDS=COPY
Back to top
View user's profile Send private message
sijayapal

New User


Joined: 23 Dec 2008
Posts: 69
Location: India

PostPosted: Thu Jun 24, 2010 2:37 pm
Reply with quote

//SORTSTP1 EXEC PGM=SORT
//SORTIN DD DSN=************,DISP=SHR
//SORTOUT DD DSN=*************,
// DISP=(NEW,CATLG,DELETE),
// UNIT=DISK,
// SPACE=(TRK,(10,10))
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE FORMAT=SS,COND=(5,2,EQ,C'95',AND,
37,1,EQ,C'J,K,L,M,N,O,P,Q,R,}')
OUTREC OVERLAY=(62:C'}')

---------------------------------------------------
The above works fine.

I have to add the below condition also to the above one.
SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=(5,2,CH,EQ,C'97'),
OVERLAY=(37:C'}',62:C'}'))
Back to top
View user's profile Send private message
sijayapal

New User


Joined: 23 Dec 2008
Posts: 69
Location: India

PostPosted: Thu Jun 24, 2010 2:38 pm
Reply with quote

Its DFSORT and we dont have SYNC SORT
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Jun 24, 2010 7:06 pm
Reply with quote

Quote:
INCLUDE FORMAT=SS,COND=(5,2,EQ,C'95',AND,
37,1,EQ,C'J,K,L,M,N,O,P,Q,R,}')
.
.
.
The above works fine.
I can't figure how this is working, but why not treat the 95 & 97 the same way you treat the J, K, L, M, N, O, P, Q, R & }?

Frank or Kolusu:
Where is it documented that "37,1,EQ,C'J,K,L,M,N,O,P,Q,R,}" acts like a string or ORs? I searched and can't find any explanations or examples.
Where is it documented that FORMAT=SS is valid in an INCLUDE? I couldn't find it in 'Table 11. Permissible Field-to-Constant Comparisons for INCLUDE/OMIT'.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Thu Jun 24, 2010 9:45 pm
Reply with quote

Refer to this post I read in my childhood...

www.ibmmainframes.com/viewtopic.php?t=5389

Something from Frank,

Quote:
Since the the separator character is generally needed, leaving it out for 1-byte fields is not actually covered in the doc, so I understand how you drew the conclusion you did. Of course, since I developed the code, I know how it actually works.



Thanks,
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Jun 24, 2010 10:23 pm
Reply with quote

Quote:
This is the problem i have in SORT. I have two conditions to be checked but i need to use a single sort card.

"IF 5,2,CH,EQ,C'95' and position 37 = J or K or L or M or N or O or P or Q or R or } THEN move } to position 62"

"IF 5,2,CH,EQ,C'97' then overwrite the position 37 and 62 with '}'."


sijayapal,

If I understand correctly what you want, then you would use these DFSORT control statements:

Code:

  OPTION COPY                                                       
  INREC IFTHEN=(WHEN=(5,2,CH,EQ,C'95',AND,37,1,SS,EQ,C'JKLMNOPQR}'),
     OVERLAY=(62:C'}')),                                             
    IFTHEN=(WHEN=(5,2,CH,EQ,C'97'),OVERLAY=(37:C'}',62:C'}'))       


Note that INCLUDE is used to include only certain records, whereas IFTHEN is used to modify only certain records.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Jun 24, 2010 11:03 pm
Reply with quote

sqlcode1 wrote:
Refer to this post I read in my childhood...

www.ibmmainframes.com/viewtopic.php?t=5389

Thanks, I guess it was my fault for limiting my search to just the z/OS V1R11.0 DFSORT Application Programming Guide.
I guess I'll be adding the z/OS V1R11.0 DFSORT: Getting Started to my search/research list now.... icon_redface.gif
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts SCOPE PENDING option -check data DB2 2
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top