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
 

 

How to write Specific Fields from Multiple Recs using Sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
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    Post subject: How to write Specific Fields from Multiple Recs using Sort
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

Moderator


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

PostPosted: Thu Jul 06, 2017 10:31 am    Post subject:
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

http://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    Post subject:
Reply with quote

Hi,

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

Moderator


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

PostPosted: Thu Jul 06, 2017 10:41 am    Post subject:
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    Post subject:
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: 1845
Location: UK

PostPosted: Thu Jul 06, 2017 3:40 pm    Post subject:
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

Active User


Joined: 29 Apr 2008
Posts: 128
Location: Maryland

PostPosted: Thu Jul 06, 2017 6:30 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing sort Card Dynamically vickey_dw DFSORT/ICETOOL 1 Sat Aug 19, 2017 2:33 pm
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 10 Fri Aug 18, 2017 10:50 am
No new posts Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm


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