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

Syncsort - Remove spaces in mid of field and realign


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
MadanVS

New User


Joined: 28 Dec 2010
Posts: 25
Location: Chennai

PostPosted: Fri Mar 11, 2011 4:14 pm
Reply with quote

Hi

I/p File : VB
O/p File : FB LRECL = 38

My input file is like:

Code:
ABCD 1234567 2004-12-31 KI1
AGCD 12 2004-12-31 KI1
ASCD 123 2004-11-31 KI1
ABGD 1 2014-12-31 KI1
ABAD 1234567 2004-12-31 KI1



I need my output file as

Code:
ABCD  2004-12-31
AGCD 2004-12-31
ASCD 2004-11-31
ABGD 2014-12-31
ABAD 2004-12-31.


Is it possible to get the desired output using sortcard?

Is it possible to check if spaces are in mid of field and if so to realign?


Thanks
Madhan
Back to top
View user's profile Send private message
nareshdacha

New User


Joined: 12 Jan 2010
Posts: 66
Location: US

PostPosted: Fri Mar 11, 2011 4:53 pm
Reply with quote

Hey Madan,
Try the below code...

Code:

//STEP010  EXEC  SORTD                         
//SORTIN   DD  *                               
ABCD 1234567 2004-12-31 KI1                     
AGCD 12 2004-12-31 KI1                         
ASCD 123 2004-11-31 KI1                         
ABGD 1 2014-12-31 KI1                           
ABAD 1234567 2004-12-31 KI1                     
//*                                             
//SORTOUT  DD  DSN=OUTPUT.DATASET,         
//             DISP=(NEW,CATLG,DELETE),                         
//             SPACE=(CYL,(5,5),RLSE),       
//             DCB=(LRECL=38,RECFM=FB)         
//*                                             
//SYSIN    DD  *                               
 SORT FIELDS=COPY                               
  INREC PARSE=(%00=(ENDBEFR=C' ',FIXLEN=5),     
               %01=(ENDBEFR=C' ',FIXLEN=8),     
               %02=(ENDBEFR=C' ',FIXLEN=11),   
          %03=(ENDBEFR=C' ',FIXLEN=3)),
       BUILD=(%00,%02)                     



Output:

ABCD 2004-12-31
AGCD 2004-12-31
ASCD 2004-11-31
ABGD 2014-12-31
ABAD 2004-12-31
Back to top
View user's profile Send private message
MadanVS

New User


Joined: 28 Dec 2010
Posts: 25
Location: Chennai

PostPosted: Fri Mar 11, 2011 5:25 pm
Reply with quote

Will try Naresh..

Thanks.

Madhan
Back to top
View user's profile Send private message
MadanVS

New User


Joined: 28 Dec 2010
Posts: 25
Location: Chennai

PostPosted: Fri Mar 11, 2011 5:40 pm
Reply with quote

Hi Naresh

My input file is of VB. I am facing the following error:
Code:

SYNCSORT LICENSED FOR CPU SERIAL NUMBER 8BC96, MODEL 2817 706             
SYSIN :                                                                   
 OPTION COPY                                                             
 INREC PARSE=(%00=(ENDBEFR=C' ',FIXLEN=12),                               
              %01=(ENDBEFR=C' ',FIXLEN=03),                               
              %02=(ENDBEFR=C' ',FIXLEN=26),                               
              %03=(ENDBEFR=C' ',FIXLEN=26),                               
              %04=(ENDBEFR=C' ',FIXLEN=10),                               
              %05=(ENDBEFR=C' ',FIXLEN=26),                               
              %06=(ENDBEFR=C' ',FIXLEN=24)),                             
              BUILD=(%00,%05)                                             
WER276B  SYSDIAG= 4250806, 9222513, 9222513, 5326800                     
WER164B  6,896K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,       
WER164B     12K BYTES RESERVE REQUESTED, 1,004K BYTES USED               
WER146B  20K BYTES OF EMERGENCY SPACE ALLOCATED                           
WER108I  SORTIN   : RECFM=VB   ; LRECL=  8196; BLKSIZE= 27998             
WER235A  INREC    RDW NOT INCLUDED                                       
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                           
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Mar 11, 2011 5:52 pm
Reply with quote

Your product is SYNCSORT and NOT DFSORT

Topic moved to JCL forum for SYNCSORT questions.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Sat Mar 12, 2011 3:09 pm
Reply with quote

Why have posted the exact same requirement AGAIN in the DFSORT forum when it is obvious, and also stated, that your product is SYNCSORT.

There are many topics on converting VB to FB and FB to VB on the forum.

Why not try that little innovation called the SEARCH button at the top of any page.

This is a HELP forum and not a post it again until somebody else does my work for me forum.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Sun Mar 13, 2011 1:07 am
Reply with quote

Hello,

What does the documentation tell you about the WER235A message?
Back to top
View user's profile Send private message
MadanVS

New User


Joined: 28 Dec 2010
Posts: 25
Location: Chennai

PostPosted: Mon Mar 14, 2011 10:48 am
Reply with quote

Thanks all ..

Got the solution:

Used this sort card
Code:

OPTION COPY                           
OUTFIL VTOF,                         
PARSE=(%00=(ENDBEFR=X'05',FIXLEN=12),
       %01=(ENDBEFR=X'05',FIXLEN=03),
       %02=(ENDBEFR=X'05',FIXLEN=26),
       %03=(ENDBEFR=X'05',FIXLEN=26),
       %04=(ENDBEFR=X'05',FIXLEN=10),
       %05=(ENDBEFR=X'05',FIXLEN=26),
       %06=(ENDBEFR=X'05',FIXLEN=24)),
BUILD=(%00,%05)                     
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Mon Mar 14, 2011 11:14 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Remove leading zeroes SYNCSORT 4
No new posts leading spaces can be removed in trai... DFSORT/ICETOOL 1
Search our Forums:

Back to Top