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
 

 

Condition in GROUP

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

New User


Joined: 05 Dec 2012
Posts: 5
Location: USA

PostPosted: Wed Dec 05, 2012 7:57 am    Post subject: Condition in GROUP
Reply with quote

Hi my input file is


Code:
  MMM-FIELD-S                                 
  MMM-FIELD-1
 *MMM-FIELD-2
  MMM-FIELD-E
  MMM-FIELD-1
  MMM-FIELD-S
 *MMM-FIELD-1
  MMM-FIELD-2
  MMM-FIELD-E
  MMM-FIELD-S
  MMM-FIELD-1
  MMM-FIELD-2
  MMM-FIELD-3
  MMM-FIELD-E


My output should be like this

Code:
  MMM-FIELD-S                                 
  MMM-FIELD-1
 *MMM-FIELD-2
  MMM-FIELD-E
 MMM-FIELD-S
 *MMM-FIELD-1
  MMM-FIELD-2
  MMM-FIELD-E



I used group command to get the above input file, now from those i want to pick the records which has '*' as first character within the group ( i.e Begin MMM-FIELD-S and the end MMM-FIELD-E)

Please let me know whether this is posible , if so let me know how
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Dec 05, 2012 8:20 am    Post subject:
Reply with quote

Hello and welcome to the forum,

Is there some reason to run one Sort process just to create input to another?

If you post the original input (with something that looks like real data rather than the alphabet soup) and the final output needed when the sample input is processed, you may have more luck getting help.

I don't understand your "rules" to get from the input to the output. Clarification would help.

What are the recfm and lrecl of the input and output files?

When posting the data, please use the Code tag to preserve alignment and improve readability. There is a Preview so you can see your post as it will be seen by the forum.
Back to top
View user's profile Send private message
Emmanual123

New User


Joined: 05 Dec 2012
Posts: 5
Location: USA

PostPosted: Wed Dec 05, 2012 9:11 am    Post subject: Reply to: Condition in GROUP
Reply with quote

Thankyou for the reply.....

Its like I have an input file , with the below mentioned format


Code:
  Member-ID                       112354
  member-group                  d234555
  Member-benifit-cd              b1
 *Member-effective date       20101111
 *member-expirydate           99999999
  member-accum-amt           10678
  member-division                123
  Member-ID                       112354
  member-group                  d234555
  Member-effective date       20101111
  member-expirydate           99999999
  member-accum-amt           10678
  member-division                123
  Member-ID                       112354
  member-group                  d234555
  Member-benifit-cd              b1
  Member-effective date       20101111
 *member-expirydate           99999999
 *member-accum-amt           10678
  member-division                123
  Member-ID                       112354
  member-group                  d234555
  Member-benifit-cd              b1
  member-expirydate           99999999
  member-accum-amt           10678
  member-division                123
  Member-ID                       112354
  member-group                  d234555
  Member-benifit-cd              b1
  Member-effective date       20101111
 *member-expirydate           99999999
  member-accum-amt           10678
  member-division                123


the * will be at 2nd column, the fields will start at 3rd column....

the file length is 133

The group will start with the field Member-id and Ends with member-divison..... between those fields there will be many fields .... in one case there are five fields or three in another case -....

'*' will be there only in the fields between start and end

I want to pick up the group along with the fields which has '*' at any one of the fields


The output should be like this

Code:
  Member-ID                       112354
  member-group                  d234555
  Member-benifit-cd              b1
 *Member-effective date       20101111
 *member-expirydate           99999999
  member-accum-amt           10678
  member-division                123
  Member-ID                       112354
  member-group                  d234555
  Member-benifit-cd              b1
  Member-effective date       20101111
 *member-expirydate           99999999
 *member-accum-amt           10678
  member-division                123
  Member-ID                       112354
  member-group                  d234555
  Member-benifit-cd              b1
  Member-effective date       20101111
 *member-expirydate           99999999
  member-accum-amt           10678
  member-division                123


I cannot put screen shots...

Please let me know if you need more info
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Wed Dec 05, 2012 9:27 am    Post subject:
Reply with quote

What is your product DFSORT or SYNCSORT?

Also in future please make use of Code tags
Back to top
View user's profile Send private message
Emmanual123

New User


Joined: 05 Dec 2012
Posts: 5
Location: USA

PostPosted: Wed Dec 05, 2012 9:32 am    Post subject: Reply to: Condition in GROUP
Reply with quote

Syncsort ....
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Wed Dec 05, 2012 9:39 am    Post subject:
Reply with quote

This space belongs to DFSORT queries

Does your version support WHEN=GROUP and symnames?
Back to top
View user's profile Send private message
Emmanual123

New User


Joined: 05 Dec 2012
Posts: 5
Location: USA

PostPosted: Wed Dec 05, 2012 10:18 am    Post subject:
Reply with quote

oops...

yes it supports symnames and group
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed Dec 05, 2012 10:55 am    Post subject:
Reply with quote

Hi,

try this

Code:
//S1       EXEC PGM=SORT             
//SYSOUT   DD SYSOUT=*               
//SORTIN   DD *                       
MMM-FIELD-S                           
MMM-FIELD-1                           
*MMM-FIELD-2                         
MMM-FIELD-E                           
MMM-FIELD-1                           
MMM-FIELD-S                           
*MMM-FIELD-1                         
MMM-FIELD-2                           
MMM-FIELD-E                           
MMM-FIELD-S                           
MMM-FIELD-1                           
MMM-FIELD-2                           
MMM-FIELD-3                           
MMM-FIELD-E                           
//ALL      DD DSN=&&ALL,             
//            DISP=(,PASS,DELETE),                   
//            UNIT=SYSDA,                             
//            SPACE=(TRK,(10,5),RLSE)                 
//WANTED   DD DSN=&&WANTED,                           
//            DISP=(,PASS,DELETE),                   
//            UNIT=SYSDA,                             
//            SPACE=(TRK,(10,5),RLSE)                 
//SYSIN    DD *                                       
  OPTION COPY                                         
  INREC IFTHEN=(WHEN=GROUP,                           
                BEGIN=(1,11,CH,EQ,C'MMM-FIELD-S'),   
                  END=(1,11,CH,EQ,C'MMM-FIELD-E'),   
                 PUSH=(81:ID=4))                     
  OUTFIL    FNAMES=ALL,INCLUDE=(81,4,ZD,GE,+1),       
                    BUILD=(1,84)                     
  OUTFIL FNAMES=WANTED,INCLUDE=(1,1,CH,EQ,C'*'),     
                    BUILD=(81,4)                     
/*                                                   
//S2       EXEC PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                 
//SORTJNF1 DD DSN=&&WANTED,                             
//            DISP=SHR                                 
//SORTJNF2 DD DSN=&&ALL,                               
//            DISP=SHR                                 
//SORTOUT DD SYSOUT=*                                   
//SYSIN DD *                                           
  JOINKEYS FILE=F1,FIELDS=(01,04,A),SORTED             
  JOINKEYS FILE=F2,FIELDS=(81,04,A),SORTED             
  REFORMAT FIELDS=(F2:01,80)                           
  SORT FIELDS=COPY                                     
/*                                                     


Gerry
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Dec 05, 2012 3:38 pm    Post subject: Reply to: Condition in GROUP
Reply with quote

Emmanual123,

If your SyncSort supports JNFnCNTL files (consult your documentation) then Gerry's solution can be applied in one step.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Dec 05, 2012 3:51 pm    Post subject:
Reply with quote

Emmanual123,

Can you please post expected output for example you shown. i.e.
Code:

  Member-ID                       112354
  member-group                  d234555
  Member-benifit-cd              b1
 *Member-effective date       20101111
 *member-expirydate           99999999
  member-accum-amt           10678
  member-division                123
  Member-ID                       112354
  member-group                  d234555
  Member-benifit-cd              b1
  Member-effective date       20101111
 *member-expirydate           99999999
 *member-accum-amt           10678
  member-division                123
  Member-ID                       112354
  member-group                  d234555
  Member-benifit-cd              b1
  Member-effective date       20101111
 *member-expirydate           99999999
  member-accum-amt           10678
  member-division                123


I think it will be whole file as it is in this case
Back to top
View user's profile Send private message
Emmanual123

New User


Joined: 05 Dec 2012
Posts: 5
Location: USA

PostPosted: Thu Dec 06, 2012 9:25 am    Post subject: Reply to: Condition in GROUP
Reply with quote

Thank You gcicchet , it worked. Thank you all ..........
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Dec 06, 2012 8:51 pm    Post subject: Reply to: Condition in GROUP
Reply with quote

Good to hear it is working - thank you for letting us know icon_smile.gif

d
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
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
No new posts INCLUDE condition questions van bui DFSORT/ICETOOL 1 Thu Jun 30, 2016 9:52 am
No new posts Select first 2 group data vice_versa DFSORT/ICETOOL 10 Mon Jun 13, 2016 2:21 pm


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