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

How to write Specific Fields from Multiple Recs using Sort


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Padhu

New User


Joined: 06 Jul 2017
Posts: 3
Location: INDIA

PostPosted: Thu Jul 06, 2017 10:26 am
Reply with quote

Hi,

I have a Requirement as below.

The Input File Contains two record Groups - M1 & M2. I need Specific Fields to be written into the Output File from Both the Groups. Please help on this.

Input File

Code:
----+----1----+----2----+----3
M1  MEMBER1 XXXXXXXXXXXXXXXXXX
M2  GROUP1  BENEFIT1XXXXXXXXXX
M1  MEMBER2 XXXXXXXXXXXXXXXXXX
M2  GROUP2  BENEFIT2XXXXXXXXXX
M1  MEMBER3 XXXXXXXXXXXXXXXXXX
M2  GROUP3  BENEFIT3XXXXXXXXXX
M1  MEMBER4 XXXXXXXXXXXXXXXXXX
M2  GROUP4  BENEFIT4XXXXXXXXXX
M1  MEMBER5 XXXXXXXXXXXXXXXXXX
M2  GROUP5  BENEFIT5XXXXXXXXXX
M1  MEMBER6 XXXXXXXXXXXXXXXXXX
M2  GROUP6  BENEFIT6XXXXXXXXXX



Expected Output is

Code:
----+----1----+----2----+----3
MEMBER1 GROUP1 BENEFIT1XXXXXXX
MEMBER2 GROUP2 BENEFIT2XXXXXXX
MEMBER3 GROUP3 BENEFIT3XXXXXXX
MEMBER4 GROUP4 BENEFIT4XXXXXXX
MEMBER5 GROUP5 BENEFIT5XXXXXXX
MEMBER6 GROUP6 BENEFIT6XXXXXXX
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


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

PostPosted: Thu Jul 06, 2017 10:31 am
Reply with quote

Please do not post same question in multiple forum

What sort product do you use based on that I will delete one and make other active ?? Check the below link

ibmmainframes.com/viewtopic.php?t=33389
Back to top
View user's profile Send private message
Padhu

New User


Joined: 06 Jul 2017
Posts: 3
Location: INDIA

PostPosted: Thu Jul 06, 2017 10:37 am
Reply with quote

Hi,

Sorry for redundancy. Sort Product is DFSORT.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


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

PostPosted: Thu Jul 06, 2017 10:41 am
Reply with quote

Strongly urge you to go through the site rules ....


With regard to your question : WHEN=GROUP should help read the manual about the same
Back to top
View user's profile Send private message
Padhu

New User


Joined: 06 Jul 2017
Posts: 3
Location: INDIA

PostPosted: Thu Jul 06, 2017 1:55 pm
Reply with quote

Hi,

Let me add more inputs on the Input & Output Files.

Input File:
M1 Record Type
Record Format = VB; Record length = 650

M2 Record Type
Record Format = VB; Record length = 200

Output File:
Record Format = FB; Record length = 80

Below is what i did and what I Get.

SORTCARD

Code:
SORT FIELDS=COPY                                           
INREC IFTHEN=(WHEN=GROUP,RECORDS=2,                         
BEGIN=(5,2,CH,EQ,C'M1'),PUSH=(651:8,11,SEQ=1))             
OUTFIL INCLUDE=(201,1,ZD,EQ,2),BUILD=(651,11,8,8,18,37,80:X)


SYSOUT

Code:
 SYNCSORT FOR Z/OS  1.4.0.0N    U.S. PATENTS: 4210961, 5117495   (C) 2010 SYNCS
                                        HIP OF GREATER NEW YORK   z/OS   2.2.0
 SYNCSORT LICENSED FOR CPU SERIAL NUMBER 6DD96, MODEL 2828 S04             LICE
 SYSIN :                                                                       
   SORT FIELDS=COPY                                                           
   INREC IFTHEN=(WHEN=GROUP,RECORDS=2,                                         
   BEGIN=(5,2,CH,EQ,C'M1'),PUSH=(651:8,11,SEQ=1))                             
   OUTFIL INCLUDE=(201,1,ZD,EQ,2),BUILD=(651,11,8,8,18,37,80:X)               
 WER276B  SYSDIAG= 1750194, 4042382, 4042382, 3040765                         
 WER164B  6,892K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,           
 WER164B     0 BYTES RESERVE REQUESTED, 1,000K BYTES USED                     
 WER146B  16K BYTES OF EMERGENCY SPACE ALLOCATED                               
 WER108I  SORTIN   : RECFM=VB   ; LRECL=   650; BLKSIZE= 27998                 
 WER073I  SORTIN   : DSNAME=PRODS.QPNY.QVMRJ309.REFEXAM.MONTHLY  (FIRST OF 2) 
 WER257I  INREC RECORD LENGTH =   662                                         
 WER238I  POTENTIALLY INEFFICIENT USE OF INREC                                 
 WER235A  SORTOUT  OUTREC RDW NOT INCLUDED                                     
 WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                                 
 WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE               


Please Advice
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Jul 06, 2017 3:40 pm
Reply with quote

I advise that you take a lot more care. You are not using DFSort but Syncsort. Just read the first line of your posted output.
Moving topic.
I also suggest that if you asked to read a reference then you actually READ it.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2018
Location: USA

PostPosted: Thu Jul 06, 2017 6:30 pm
Reply with quote

This error message is in plain English:
Quote:
WER235A SORTOUT OUTREC RDW NOT INCLUDED

Which part of it is not clear?

Just FYI:
RDW stands for Record Descriptor Word = 4-byte prefix attached in zOS to any record with RECFM=V(B)

You need either to define RDW positions explicitly, or to convert the output to RECFM=F(B) using keyword VTOF.
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 -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
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 Write line by line from two files DFSORT/ICETOOL 7
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top