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

SYNCSORT - Omit the first character of the first record...


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

New User


Joined: 13 Mar 2006
Posts: 63
Location: italy

PostPosted: Fri Jan 18, 2008 7:19 pm
Reply with quote

How Can I omit the first comma???

My input have a lenght of 13 and is a FB format.

INPUT
Quote:
,'0000001354'
,'0000001524'
,'0000004110'
,'0000004176'
,'0000004341'
,'0000004444'
,'0000004446'
,'0000004529'
,'0000004557'
,'0000004808'


OUTPUT
Quote:
'0000001354'
,'0000001524'
,'0000004110'
,'0000004176'
,'0000004341'
,'0000004444'
,'0000004446'
,'0000004529'
,'0000004557'
,'0000004808'


Thanks a lot
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Fri Jan 18, 2008 8:14 pm
Reply with quote

miosne,

You can use sort util, to remove the comma. Here is the sample code -

Code:
//STEP@@@ EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN DD DSN=i/p file (LRECL=13)
//SORTOUT DD DSN=o/p file (LRECL=12)
//SYSIN DD *
   SORT FIELDS=COPY
   OUTREC FIELDS=(2,12)
/*
Back to top
View user's profile Send private message
miosne
Warnings : 1

New User


Joined: 13 Mar 2006
Posts: 63
Location: italy

PostPosted: Fri Jan 18, 2008 8:51 pm
Reply with quote

murmohk1,


If I use this sort card I'll remove every comma of every record in the I/P.

I want to eliminate only the first comma of the first record, like the O/P example.
Back to top
View user's profile Send private message
Ganesh.Deokar

New User


Joined: 30 Sep 2005
Posts: 26
Location: Buffalo,NY

PostPosted: Fri Jan 18, 2008 9:59 pm
Reply with quote

Try this:

Code:
//JOBNAME  JOB REGION=8M,MSGCLASS=J,NOTIFY=USERID             
//*                                                           
//STEP001  EXEC PGM=SORT                                       
//*                                                           
//SYSOUT   DD SYSOUT=*                                         
//SYSPRINT DD SYSOUT=*                                         
//*                                                           
//SORTIN   DD DSN=YOUR.INPUT.FILE,DISP=SHR                     
//SORTOUT  DD DSN=&&TEMP1,DISP=(NEW,PASS,DELETE),             
//         SPACE=(TRK,(1,1)),DCB=(RECFM=FB,LRECL=21,BLKSIZE=0)
//SYSIN    DD *                                               
  SORT FIELDS=COPY                                             
  OUTREC FIELDS=(1:1,13,14:SEQNUM,8,ZD)                       
/*                                                             
//STEP002  EXEC PGM=SORT                                       
//*                                                           
//SYSOUT   DD SYSOUT=*                                         
//SYSPRINT DD SYSOUT=*                                         
//*                                                             
//SORTIN   DD DSN=&&TEMP1,DISP=(OLD,PASS,DELETE)                 
//SORTOUT  DD DSN=YOUR.SORTOUT.FILE,DISP=(NEW,CATLG,DELETE),     
//         SPACE=(TRK,(1,1)),DCB=(RECFM=FB,LRECL=13,BLKSIZE=0)   
//SYSIN    DD *                                                 
  SORT FIELDS=COPY                                               
  OUTREC FIELDS=(1,13)                                           
  INREC IFTHEN=(WHEN=(14,8,ZD,EQ,1,AND,1,1,CH,EQ,C','),         
         BUILD=(1:2,12)),                                       
         IFTHEN=(WHEN=(14,8,ZD,GT,1),                           
         BUILD=(1:1,13))                                         
/*                                                               


Regards,
Ganesh
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Fri Jan 18, 2008 10:12 pm
Reply with quote

Ganesh's application can be condensed into a single step.
Try the following:

Code:

//SORT1 EXEC PGM=SORT                             
//SORTIN  DD  *     
,'0000001354'           
,'0000001524'           
,'0000004110'           
,'0000004176'           
,'0000004341'           
,'0000004444'           
,'0000004446'           
,'0000004529'           
,'0000004557'           
,'0000004808'           
//SORTOUT DD DSN=OUTPUT.FILE
//SYSIN      DD *                                           
   INREC FIELDS=(1,13,14:SEQNUM,8,ZD)                 
   SORT FIELDS=COPY                                       
   OUTFIL FILES=OUT,                                   
       IFTHEN=(WHEN=(14,8,ZD,EQ,1),                 
           BUILD=(1:2,12)),                           
       IFTHEN=(WHEN=(14,8,ZD,GT,1),                 
           BUILD=(1:1,13))                           
//SYSOUT   DD  SYSOUT=*                   
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Sat Jan 19, 2008 9:20 am
Reply with quote

Another way to do the same
Code:
//SORTIN   DD *                                     
,'0000001354'                                       
,'0000001524'                                       
,'0000004110'                                       
,'0000004176'                                       
,'0000004341'                                       
,'0000004444'                                       
,'0000004446'                                       
,'0000004529'                                       
,'0000004557'                                       
,'0000004808'                                       
//SORTOUT  DD SYSOUT=*                               
//SYSIN    DD *                                     
  OPTION COPY                                       
  OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),
         IFTHEN=(WHEN=(81,8,ZD,EQ,+1),BUILD=(2,79)),
         IFOUTLEN=80                                 
Back to top
View user's profile Send private message
miosne
Warnings : 1

New User


Joined: 13 Mar 2006
Posts: 63
Location: italy

PostPosted: Sat Jan 19, 2008 2:49 pm
Reply with quote

Thanks a lot to everyone.

Avete risolto i miei problemi, grazie mille.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Sat Jan 19, 2008 4:48 pm
Reply with quote

miosne wrote:
Avete risolto i miei problemi, grazie mille.
icon_rolleyes.gif ..Decode this please..
Back to top
View user's profile Send private message
miosne
Warnings : 1

New User


Joined: 13 Mar 2006
Posts: 63
Location: italy

PostPosted: Sat Jan 19, 2008 5:01 pm
Reply with quote

They have solved my problem.
Thanks a lot!!!!!!!!!!!!!1
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Jan 21, 2008 6:06 pm
Reply with quote

oh.. k ..Thanks for decoding.. icon_smile.gif
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
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 Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top