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 file in sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Formatting file in sort
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: 2285
Location: @my desk

PostPosted: Fri Jan 23, 2009 11:28 am    Post subject:
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    Post subject: Re:Formatting file in sort
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: 2285
Location: @my desk

PostPosted: Fri Jan 23, 2009 11:52 am    Post subject:
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    Post subject: Re : Formatting file in sort
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: 2285
Location: @my desk

PostPosted: Fri Jan 23, 2009 2:47 pm    Post subject:
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    Post subject: Re:Formatting file in sort
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    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 File Aid tool to compare numeric data balaji81_k DFSORT/ICETOOL 0 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 8 Fri Sep 22, 2017 11:35 pm
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm

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