MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

to add characters before and after a line

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Fri Oct 12, 2007 4:03 pm    Post subject: to add characters before and after a line Reply with quote

This is my input data set

Code:

COPY OUTDD=OUTPUT,INDD=((INPUT,R))
   AB1O1000                       
   AB105000                       
   AB107000                       
   RE00TPG0                       
   SFDABLRD                       
   UM158000                       
   UU631600                       
   UU641600                       


I want output dataset as

Code:

COPY OUTDD=OUTPUT,INDD=((INPUT,R))
SELECT MEMBER=(AB1O1000)
SELECT MEMBER=(AB105000)
SELECT MEMBER=(AB107000)
SELECT MEMBER=(RE00TPG0)
SELECT MEMBER=(SFDABLRD)
SELECT MEMBER=(UM158000)
SELECT MEMBER=(UU631600)
SELECT MEMBER=(UU641600)


Could any one help me?
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Oct 12, 2007 4:29 pm    Post subject: Reply with quote

Here's a DFSORT job that will do what you asked for and will also handle member names less than 8 characters, which I assume you might have (I threw one into the input data for completeness).

Code:

//S1    EXEC  PGM=ICEMAN                               
//SYSOUT    DD  SYSOUT=*                               
//SORTIN DD *                                         
COPY OUTDD=OUTPUT,INDD=((INPUT,R))                     
   AB1O1000                                           
   AB105000                                           
   AB107000                                           
   RE00TPG0                                           
   SFDABLRD                                           
   UM158000                                           
   UU631600                                           
   UU641600                                           
   ABC   
/*                                             
//SORTOUT DD DSN=...  output file (FB/80)                               
//SYSIN    DD    *
  OPTION COPY                                   
  INREC IFTHEN=(WHEN=(1,5,CH,NE,C'COPY'),       
    BUILD=(1,80,JFY=(LEAD=C'SELECT MEMBER=(',   
       SHIFT=LEFT,TRAIL=C')')))                 
/*                               


SORTOUT would have:

Code:

COPY OUTDD=OUTPUT,INDD=((INPUT,R)) 
SELECT MEMBER=(AB1O1000)           
SELECT MEMBER=(AB105000)           
SELECT MEMBER=(AB107000)           
SELECT MEMBER=(RE00TPG0)           
SELECT MEMBER=(SFDABLRD)           
SELECT MEMBER=(UM158000)           
SELECT MEMBER=(UU631600)           
SELECT MEMBER=(UU641600)           
SELECT MEMBER=(ABC)                 

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
i_suman
Beginner


Joined: 11 Oct 2007
Posts: 3
Topics: 1

PostPosted: Sat Oct 13, 2007 1:31 am    Post subject: Reply with quote

Thanks Frank,
But I am facing below syntax problem. I spent more than 5 hours to fix this problem, but unsuccessful.

Code:

 SYSIN :                                       
   OPTION COPY                                 
     INREC IFTHEN=(WHEN=(1,5,CH,NE,C'COPY'),   
       BUILD=(1,80,JFY=(LEAD=C'SELECT MEMBER=(',
                   *                           
          SHIFT=LEFT,TRAIL=C')')))             
 WER268A  INREC STATEMENT   : SYNTAX ERROR     
 WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000 
 WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE 


Please have a look and help me.
Back to top
View user's profile Send private message
CraigG
Intermediate


Joined: 02 May 2007
Posts: 202
Topics: 0
Location: Viginia, USA

PostPosted: Sat Oct 13, 2007 10:29 am    Post subject: Reply with quote

You are using SYNCSORT not DFSORT.
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Sat Oct 13, 2007 12:21 pm    Post subject: Reply with quote

i suman,

My job works fine with DFSORT, which has had the JFY function available since April, 2006. However, the WER messages indicate you're using Syncsort, not DFSORT. Syncsort doesn't support JFY so you can't "fix the problem" no matter how much time you spend on it.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
i_suman
Beginner


Joined: 11 Oct 2007
Posts: 3
Topics: 1

PostPosted: Sat Oct 13, 2007 8:09 pm    Post subject: Reply with quote

Many thanks Frank.

I think we can achieve this output using Fileaid/Batch. I am successful to some extent using Fileaid.

Could any one help me to achieve this using fileaid batch?
Back to top
View user's profile Send private message
krisprems
Beginner


Joined: 13 Dec 2006
Posts: 101
Topics: 4
Location: india

PostPosted: Sat Oct 13, 2007 10:35 pm    Post subject: Reply with quote

vak255
For the input that you have shown, this SORT JOB should work fine.
Code:
//*******************************************************               
//STEP1    EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD *                                                         
COPY OUTDD=OUTPUT,INDD=((INPUT,R))                                     
   AB1O1000                                                             
   AB105000                                                             
   AB107000                                                             
   RE00TPG0                                                             
   SFDABLRD                                                             
   UM158000                                                             
   UU631600                                                             
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
   UU641600                                                             
/*                                                                     
//SORTOUT  DD SYSOUT=*                                                 
//SYSIN    DD *                                                         
  SORT FIELDS=COPY                                                     
  OUTREC IFTHEN=(WHEN=(1,1,CH,NE,C'C'),                                 
                 BUILD=(C'SELECT MEMBER=(',4,8,C')'))                   
/*       


SORTOUT contains:
Code:
COPY OUTDD=OUTPUT,INDD=((INPUT,R))
SELECT MEMBER=(AB1O1000)           
SELECT MEMBER=(AB105000)           
SELECT MEMBER=(AB107000)           
SELECT MEMBER=(RE00TPG0)           
SELECT MEMBER=(SFDABLRD)           
SELECT MEMBER=(UM158000)           
SELECT MEMBER=(UU631600)           
SELECT MEMBER=(UU641600)   

_________________
cHEERs
krisprems
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon Oct 15, 2007 10:25 am    Post subject: Reply with quote

Quote:
For the input that you have shown, this SORT JOB should work fine.


Yes, that's true if the member names are really always 8 characters long which would be a special case since member names can be 1-8 characters. With that solution, if any member name is less than 8 characters, it will not be enclosed in quotes, e.g. for a member name of ABC, the output would be:

Code:

SELECT MEMBER=(ABC     )   


The DFSORT job I showed will work for member names of 1-8 characters. The job you show will work in special cases.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group