View previous topic :: View next topic
Author
Message
Sachinrethin New User Joined: 12 Oct 2007Posts: 21 Location: Chennai
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
Arun Raj Moderator Joined: 17 Oct 2006Posts: 2481 Location: @my desk
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
Sachinrethin New User Joined: 12 Oct 2007Posts: 21 Location: Chennai
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
Arun Raj Moderator Joined: 17 Oct 2006Posts: 2481 Location: @my desk
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
Sachinrethin New User Joined: 12 Oct 2007Posts: 21 Location: Chennai
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
Arun Raj Moderator Joined: 17 Oct 2006Posts: 2481 Location: @my desk
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
Sachinrethin New User Joined: 12 Oct 2007Posts: 21 Location: Chennai
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
Please enable JavaScript!