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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: SYNCSORT - Omit the first character of the first record...
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: 1439
Location: Bangalore,India

PostPosted: Fri Jan 18, 2008 8:14 pm    Post subject:
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    Post subject:
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    Post subject:
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: 500
Location: USA

PostPosted: Fri Jan 18, 2008 10:12 pm    Post subject:
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    Post subject:
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    Post subject:
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

Senior Member


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

PostPosted: Sat Jan 19, 2008 4:48 pm    Post subject:
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    Post subject:
Reply with quote

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

Senior Member


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

PostPosted: Mon Jan 21, 2008 6:06 pm    Post subject:
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    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 5 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 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
No new posts the use of 'B3'x character in a panel Pedro TSO/ISPF 1 Thu Feb 16, 2017 3:09 am


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