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
 
DF SORT with OVERLAY & INCLUDE OPTION

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: DF SORT with OVERLAY & INCLUDE OPTION
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: 8593
Location: Back in jolly old England

PostPosted: Thu Jun 24, 2010 2:15 pm    Post subject: Re: DF SORT with OVERLAY & INCLUDE OPTION
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    Post subject: Reply to: DF SORT with OVERLAY & INCLUDE OPTION
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    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Thu Jun 24, 2010 7:06 pm    Post subject:
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: 578
Location: USA

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

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

http://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 Moderator


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

PostPosted: Thu Jun 24, 2010 10:23 pm    Post subject:
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: 2150
Location: At my coffee table

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

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

http://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    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 More than 1 Include criteria for sing... Roy Ware SYNCSORT 6 Wed Sep 13, 2017 11:45 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm
No new posts Changing sort Card Dynamically vickey_dw DFSORT/ICETOOL 5 Sat Aug 19, 2017 2:33 pm
No new posts SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am

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