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
 

 

Formatting record - need help

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Formatting record - need help
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: 500
Location: USA

PostPosted: Thu Oct 16, 2008 1:39 am    Post subject: Re: Formatting record - need help
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: 2239
Location: @my desk

PostPosted: Thu Oct 16, 2008 9:56 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am


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