Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SEQuence No. Inside a Group!

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
fredrick andrews

New User


Joined: 10 Jun 2010
Posts: 52
Location: chennai

PostPosted: Mon Feb 21, 2011 11:53 pm    Post subject: SEQuence No. Inside a Group!
Reply with quote

Hi Experts,

I have this requirement.

I tried this job card and got something different ..

File : 500 FB


Code:


JOB CARD

//S1 EXEC PGM=SORT                                       
//SYSOUT DD SYSOUT=*                                     
//SORTIN DD *

1111
POEA
2222
3333
POEA
2222
3333
5555
****
5555
POEA
3333
5555
****
5555
POEA
2222
5555
7777
POEA
6355
4445





//SORTOUT  DD SYSOUT=*

//SYSIN DD *                                             
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,4,CH,EQ,C'POEA'),   
  PUSH=(501:ID=8))                                       
  SORT FIELDS=(501,8,ZD,A)                               
/*                                                       







I am getting :


Code:

1111   
POEA   00000001
2222   00000001
3333   00000001
POEA   00000002
2222   00000002
3333   00000002
5555   00000002
****   00000002
5555   00000002
POEA   00000003
3333   00000003
5555   00000003
****   00000003
5555   00000003
POEA   00000004
2222   00000004
5555   00000004
7777   00000004
POEA   00000005
6355   00000005
4445   00000005






But, I want something like this:

Code:

1111   
POEA   00000001
2222   00000002
3333   00000003
POEA   00000001
2222   00000002
3333   00000003
5555   00000004
****   00000005
5555   00000006
POEA   00000001
3333   00000002
5555   00000003
****   00000004
5555   00000005
POEA   00000001
2222   00000002
5555   00000003
7777   00000004
POEA   00000001
6355   00000002
4445   00000003




Is this possible?
Appreciate all the help!

Thanks for looking.
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: Tue Feb 22, 2011 12:09 am    Post subject:
Reply with quote

If would have been helpful if you'd explained the "rules" for getting from input to output, but based on what you've said, I'm guessing that these DFSORT control statements will give you what you want:

Code:

  OPTION COPY                                         
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,4,CH,EQ,C'POEA'), 
  PUSH=(501:SEQ=8))                                   
Back to top
View user's profile Send private message
fredrick andrews

New User


Joined: 10 Jun 2010
Posts: 52
Location: chennai

PostPosted: Tue Feb 22, 2011 12:24 am    Post subject:
Reply with quote

Frank Yaeger wrote:
If would have been helpful if you'd explained the "rules" for getting from input to output, but based on what you've said, I'm guessing that these DFSORT control statements will give you what you want:

Code:

  OPTION COPY                                         
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,4,CH,EQ,C'POEA'), 
  PUSH=(501:SEQ=8))                                   



The 'POEA' record should be labelled 00000001
and the following records will have the sequence continuing 00000002 ,
00000003 , 00000004 and so on. This will happen till another 'POEA' record is encountered . The sequence again starts 00000001 and so on till the next 'POEA' record.


Code:


1111   
POEA   00000001          -> Sequence starts
2222   00000002           -> Goes on
3333   00000003         
POEA   00000001           -> Starts again
2222   00000002
3333   00000003
5555   00000004
****   00000005
5555   00000006
POEA   00000001            -> Starts again
3333   00000002
5555   00000003
****   00000004
5555   00000005
POEA   00000001
2222   00000002
5555   00000003
7777   00000004
POEA   00000001
6355   00000002
4445   00000003






Hope I am clear.

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: Tue Feb 22, 2011 12:34 am    Post subject:
Reply with quote

Yes, that's what I guessed and my solution gives that output.

Did you bother to try my solution?
Back to top
View user's profile Send private message
fredrick andrews

New User


Joined: 10 Jun 2010
Posts: 52
Location: chennai

PostPosted: Tue Feb 22, 2011 12:37 am    Post subject:
Reply with quote

Frank Yaeger wrote:
Yes, that's what I guessed and my solution gives that output.

Did you bother to try my solution?



Yes! It worker perfectly as expected.
Thanks again. icon_biggrin.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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Why TS/OP would Not contact site supp... RahulG31 All Other Mainframe Topics 2 Wed Mar 22, 2017 7:46 am
No new posts Sorting group data rajella DFSORT/ICETOOL 4 Sun Jan 22, 2017 11:32 pm
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts Access SQLCA fields inside a stored p... gangapd DB2 6 Thu Oct 27, 2016 10:20 am
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us