Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 2285
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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Repeat part of record multiple times Learncoholic DFSORT/ICETOOL 4 Tue Aug 29, 2017 11:33 am
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us