View previous topic :: View next topic
Author
Message
ramsri Active User Joined: 18 Oct 2008Posts: 380 Location: India
Hi,
My input data (LRECL=80,RECFM=FB) looks like below:
Input:
Code:
XXXXXXXX TYPE=ENTRY,GROUP=ABCDEFGH,USRID=AZBCDEF
YYYYYYYY TYPE=ENTRY,GROUP=ABC123,USRID=ABZDBA
ZZZZZZZZ TYPE=ENTRY,GROUP=XYZ01234,USRID=XYZMBT
AAAAAAAA TYPE=ENTRY,GROUP=GUNSH1P,USRID=CUGMIG
I want this data to be reformatted to below fashion:
The value appearing after "GROUP=" should sit at 1st column and value appearing after "USRID=" should sit at 21st column.
Expected Output:
Code:
----+----1----+----2----+----3
ABCDEFGH AZBCDEF
ABC123 ABZDBA
XYZ01234 XYZMBT
GUNSH1P CUGMIG
Please help.
Thanks.
Back to top
superk Global Moderator Joined: 26 Apr 2004Posts: 4652 Location: Raleigh, NC, USA
Looks like a simple PARSE.
Back to top
Bill Woodger Moderator Emeritus Joined: 09 Mar 2011Posts: 7309 Location: Inside the Matrix
Yes, "starting after" GROUP= and USERID=, "ending at" comma.
Back to top
ramsri Active User Joined: 18 Oct 2008Posts: 380 Location: India
I have written this based on your suggestions but goes for a toss
Code:
//SYSIN DD *
INCLUDE COND=(1,80,SS,EQ,C'GROUP=')
INREC FIELDS=(31,22)
SORT FIELDS=(21,8,CH,A)
OUTREC PARSE=(%00=(ENDBEFR=C',U',FIXLEN=8),
%01=(STARTAFT=C'D=',ENDBEFR=C',',FIXLEN=7)),
BUILD=(1:%00,21:%01,53X)
SYSOUT:
Code:
SYSIN :
INCLUDE COND=(1,80,SS,EQ,C'GROUP=')
INREC FIELDS=(31,22)
SORT FIELDS=(21,8,CH,A)
OUTREC PARSE=(%00=(ENDBEFR=C',U',FIXLEN=8),
%01=(STARTAFT=C'D=',ENDBEFR=C',',FIXLEN=7)),
BUILD=(1:%00,21:%01,53X)
WER276B SYSDIAG= 31702, 693460, 693460, 1437600
WER164B 23,428K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 1,012K BYTES USED
WER146B 12K BYTES OF EMERGENCY SPACE ALLOCATED
WER108I SORTIN : RECFM=FB ; LRECL= 80; BLKSIZE= 27920
WER257I INREC RECORD LENGTH = 22
WER027A CONTROL FIELD BEYOND RECORD
Please help.
Thanks.
Back to top
mistah kurtz Active User Joined: 28 Jan 2012Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
I don't have syncsort, but I tried something more simple like this in DFSORT and it's working fine.
Code:
OPTION COPY
INREC PARSE=(%00=(STARTAFT=C'GROUP=',ENDBEFR=C',',FIXLEN=08),
%01=(STARTAFT=C'USRID=',FIXLEN=07)),
BUILD=(%00,%01)
Back to top
ramsri Active User Joined: 18 Oct 2008Posts: 380 Location: India
mistah kurtz, thanks.......I got the below results with your job card -
Code:
ABCDEFGHAZBCDEF
ABC123 ABZDBA
XYZ01234XYZMBT
GUNSH1P CUGMIG
But, what was wrong with my sysin that it had to abend.......thanks.
Back to top
Bill Woodger Moderator Emeritus Joined: 09 Mar 2011Posts: 7309 Location: Inside the Matrix
Look up the message.
Look at the sysout.
Take out the SORT statement.
Then look at your output.
From all this (if not from reading the control cards) you should realise that you are making a 22-byte record (the BUILD=) and then attempting to SORT if from start-position 21 for a length of eight. So, control field beyond end of record...
Back to top
Please enable JavaScript!