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

Formatting file in sort


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

New User


Joined: 12 Oct 2007
Posts: 21
Location: Chennai

PostPosted: Fri Jan 23, 2009 11:25 am
Reply with quote

Hi All,


Could you please help me on this ?

My input file content: (RECFM FB, LRECL 80)

TEDDIR
TGRPM
TGRPMV
TMMRD
TMPLPR
TMRSM
TMRSMV
TQUOT1
TQUOT2
xyx

I need this file in the below mentioned format:

(just add single quote in the beginning and end of the string’ . The maximum length of this string is 8 char.

My sample output file:


‘TEDDIR’
‘TGRPM’
‘TGRPMV’
‘TMMRD’
‘TMPLPR’
‘TMRSM’
‘TMRSMV’
‘TQUOT1’
‘TQUOT2’
‘xyx’

Please let me know if you need more information. (sorting order is not important)

PS: Is it possible through SYNCSORT?

Thanks,


Rethin..
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri Jan 23, 2009 11:28 am
Reply with quote

Rethin,

I think you can do it if you have SyncSort for z/OS 1.3. What version of SyncSort are you having?

PS. Please be aware that SyncSort questions are discussed in the JCL forum.
Back to top
View user's profile Send private message
Sachinrethin

New User


Joined: 12 Oct 2007
Posts: 21
Location: Chennai

PostPosted: Fri Jan 23, 2009 11:36 am
Reply with quote

Hi Arun,

We are using SYNCSORT FOR Z/OS 1.3.1.0R in our shop.


Could you please let me know the step to do this?
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri Jan 23, 2009 11:52 am
Reply with quote

Rethin,

The below SyncSort job should do the trick for you.
Code:
//STEP1  EXEC PGM=ICEMAN                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD *                                               
TEDDIR                                                         
TGRPM                                                         
TGRPMV                                                         
TMMRD                                                         
TMPLPR                                                         
TMRSM                                                         
TMRSMV                                                         
TQUOT1                                                         
TQUOT2                                                         
xyx
12345678                                                           
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *                                               
  OPTION COPY                                                 
  INREC OVERLAY=(2:1,8,1:C'''',10:C'''',1:1,10,SQZ=(SHIFT=LEFT))

SORTOUT
Code:
'TEDDIR' 
'TGRPM'   
'TGRPMV' 
'TMMRD'   
'TMPLPR' 
'TMRSM'   
'TMRSMV' 
'TQUOT1' 
'TQUOT2' 
'xyx'
'12345678'
Back to top
View user's profile Send private message
Sachinrethin

New User


Joined: 12 Oct 2007
Posts: 21
Location: Chennai

PostPosted: Fri Jan 23, 2009 12:56 pm
Reply with quote

Hi Arun,


Thanks a lot for your timely Help!

Your code works for me..

Can you please give me some docs link to refer the SQZ function and pls explain the code
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri Jan 23, 2009 2:47 pm
Reply with quote

Sachinrethin,

You're welcome. You can find the detailed description of the 'SQZ' operator in the SyncSort manual.

SyncSort manuals are copyrighted material and cannot be shared. If you dont have one, please contact SyncSort Support or you can send a PM to Alissa Margulies(Moderator). I m sure they'll assit you to get the manual soon.
Back to top
View user's profile Send private message
Sachinrethin

New User


Joined: 12 Oct 2007
Posts: 21
Location: Chennai

PostPosted: Fri Jan 23, 2009 3:01 pm
Reply with quote

Hi,


I just tried to solve this using another logic, ( but not the shotest one)

SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(2,1,CH,EQ,C' '),OVERLAY=(2:X'7D')),
IFTHEN=(WHEN=(3,1,CH,EQ,C' '),OVERLAY=(3:X'7D')),
IFTHEN=(WHEN=(4,1,CH,EQ,C' '),OVERLAY=(4:X'7D')),
IFTHEN=(WHEN=(5,1,CH,EQ,C' '),OVERLAY=(5:X'7D')),
IFTHEN=(WHEN=(6,1,CH,EQ,C' '),OVERLAY=(6:X'7D')),
IFTHEN=(WHEN=(7,1,CH,EQ,C' '),OVERLAY=(7:X'7D')),
IFTHEN=(WHEN=(8,1,CH,EQ,C' '),OVERLAY=(8:X'7D')),
IFTHEN=(WHEN=(9,1,CH,EQ,C' '),OVERLAY=(9:X'7D'))
OUTREC FIELDS=(1:X'7D',2:1,8,10:61X)
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top