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
 

 

syncsort - data reformat

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Thu Aug 29, 2013 7:05 pm    Post subject: syncsort - data reformat
Reply with quote

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
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Thu Aug 29, 2013 9:23 pm    Post subject: Reply to: syncsort - data reformat
Reply with quote

Looks like a simple PARSE.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Aug 29, 2013 11:01 pm    Post subject: Reply to: syncsort - data reformat
Reply with quote

Yes, "starting after" GROUP= and USERID=, "ending at" comma.
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Fri Aug 30, 2013 5:43 pm    Post subject: Reply to: syncsort - data reformat
Reply with quote

I have written this based on your suggestions but goes for a toss icon_sad.gif

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
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 268
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Fri Aug 30, 2013 6:54 pm    Post subject:
Reply with quote

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
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Fri Aug 30, 2013 7:51 pm    Post subject: Reply to: syncsort - data reformat
Reply with quote

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Aug 30, 2013 8:04 pm    Post subject: Reply to: syncsort - data reformat
Reply with quote

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
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 syncsort: copy lines after the keyword shreya19 SYNCSORT 1 Fri Dec 02, 2016 9:47 am
No new posts ODPP(Optim Data privacy Provider) Iss... Rama kishore IBM Tools 1 Mon Nov 07, 2016 5:46 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts Can sending 5 MB data between cobol p... Kevin Vaz CICS 12 Tue Oct 18, 2016 4:50 pm
No new posts output data in CSV Format janmejay COBOL Programming 8 Sat Oct 15, 2016 2:20 pm


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