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

Formatting record - need help


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

New User


Joined: 11 Aug 2005
Posts: 85
Location: England

PostPosted: Wed Oct 15, 2008 2:05 pm
Reply with quote

Hi All,

records in a file looks like,

Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----
********************************* Top of Data *********************************
.å..a.<13012D574479.D011574479     2011.......ABC1253A388721     1D...%5744792
.å..a.<13012D574479.D011574479     2011.Ø.....BCD1253H371664     1D...%5744792
.å..a.<13012D574479.D011574479     2011.Ø.....EFG1253H446734     1D...%5744792
....a.<13012N 13542..011 13542     2011.-..... 12345678          B ../- 135424
....a.<13012N 13542..011 13542     2011.-..... 34526729          B ../-7922801
....a.<13012N 13542..011 13542     2011.-..... 23456789          B ../-LAOD2 1
....a.<13012N 13542..011 13542     2011.Ø..... 99999344          Q ../-7807907
 


i want to reformat this file, by removing the leading spaces in field starting at position 47 until 65 (field length 19).

I was using the sort card like this but getting an error:
Code:


  SORT FIELDS=COPY                                     
  OUTREC IFTHEN=(WHEN=(47,1,CH,EQ,C' '),               
          BUILD=(1:48,18,19:47,1,20:1,2,BI,EDIT=(TTT)))
         IFTHEN=WHEN=(47,1,CH,NE,EQ,C' '),             
         *                                             
          BUILD=(1:47,19,20:1,2,BI,EDIT=(TTT)))         
          *                                             
  END                                                   
 WER161B  ALTERNATE PARM USED                           
 WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT       
 WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT       
 WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000         
 WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE         



Please advise where i am going wrong.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Thu Oct 16, 2008 1:39 am
Reply with quote

leo_sangha wrote:
Code:

  SORT FIELDS=COPY                                     
  OUTREC IFTHEN=(WHEN=(47,1,CH,EQ,C' '),               
          BUILD=(1:48,18,19:47,1,20:1,2,BI,EDIT=(TTT)))
         IFTHEN=WHEN=(47,1,CH,NE,EQ,C' '),             
         *                                             
          BUILD=(1:47,19,20:1,2,BI,EDIT=(TTT)))         
          *                                             
  END                                                   
 WER161B  ALTERNATE PARM USED                           
 WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT       
 WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT       
 WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000         
 WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE

Please advise where i am going wrong.

I believe you are missing a comma after the first BUILD statement and an open parenthesis before the second WHEN statement.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Oct 16, 2008 9:56 am
Reply with quote

leo_sangha,

Apart from what Alissa has pointed out, I see this one too.
Quote:
IFTHEN=WHEN=(47,1,CH,NE,EQ,C' '),


If you've only 2 IFTHEN conditions and if both are mutually exclusive you can simply use the WHEN=NONE condition instead of writing the entire condition again.
Also, if the output field positions are contigous you can omit the output field starting position.

I have modified your card accordingly and got the below results.
Code:
//SYSIN   DD *                                 
  SORT FIELDS=COPY                             
  OUTREC IFTHEN=(WHEN=(47,1,CH,EQ,C' '),       
          BUILD=(48,18,47,1,1,2,BI,EDIT=(TTT))),
         IFTHEN=(WHEN=NONE,                     
          BUILD=(47,19,1,2,BI,EDIT=(TTT)))     

Code:
ABC1253A388721     271
BCD1253H371664     271
EFG1253H446734     271
12345678           275
34526729           275
23456789           275
99999344           275
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top