View previous topic :: View next topic
Author
Message
Nitin Bhargava New User Joined: 22 May 2012Posts: 32 Location: india
I am having a file with following type of record
NITINF05G101220040000000020000000
In my requirement I want to insert character ‘C’ in first byte, Want to change 05G (7-9 byte currently in ZD) to displayable format i.e. 05G to 057 and reduce the length of field 0000000020000000 (18-34) from 16 bytes to 11 for every record. file lenght is 800, and is a FB.
Output will look like as follows:-
CNITINF0571012200400020000000
I am able to do it in multiple steps but would like to do in single step.
If possible, please share the syntax.
Back to top
dbzTHEdinosauer Global Moderator Joined: 20 Oct 2006Posts: 6966 Location: porcelain throne
show us the multiple steps that you use to achieve your results.
by the way,
you don't want someone to share something with you,
you want someone to give something to you
like the effort necessary
to think about what is in the manual
and
to generate a solution.
Back to top
kratos86 Active User Joined: 17 Mar 2008Posts: 148 Location: Anna NGR
Provide us the steps you have to achieve this output in multiple steps... it will be good starting point and we can assist you how to combine them.
Back to top
enrico-sorichetti Superior Member Joined: 14 Mar 2007Posts: 10873 Location: italy
please use intelligent titles !
Back to top
dbzTHEdinosauer Global Moderator Joined: 20 Oct 2006Posts: 6966 Location: porcelain throne
enrico-sorichetti wrote:
please use intelligent titles !
TS probably needs someone to share one with him.
Back to top
Biswajit D New User Joined: 17 Apr 2012Posts: 50 Location: India
This should work but yes, this is not a forum where people will solve your assignments.
Code:
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(9,1,CH,EQ,C'A'),OVERLAY=(9:C'1')),
IFTHEN=(WHEN=(9,1,CH,EQ,C'B'),OVERLAY=(9:C'2')),
IFTHEN=(WHEN=(9,1,CH,EQ,C'C'),OVERLAY=(9:C'3')),
IFTHEN=(WHEN=(9,1,CH,EQ,C'D'),OVERLAY=(9:C'4')),
IFTHEN=(WHEN=(9,1,CH,EQ,C'E'),OVERLAY=(9:C'5')),
IFTHEN=(WHEN=(9,1,CH,EQ,C'F'),OVERLAY=(9:C'6')),
IFTHEN=(WHEN=(9,1,CH,EQ,C'G'),OVERLAY=(9:C'7')),
IFTHEN=(WHEN=(9,1,CH,EQ,C'H'),OVERLAY=(9:C'8')),
IFTHEN=(WHEN=(9,1,CH,EQ,C'I'),OVERLAY=(9:C'9'))
OUTREC FIELDS=(1:C'C',2:1,6,8:7,3,11:10,8,19:23,11)
Back to top
Nitin Bhargava New User Joined: 22 May 2012Posts: 32 Location: india
Thanks all.
I used folowing steps earlier:
SORT FIELDS=COPY
OUTREC FIELDS= (1:C’C’,2:1,799)
For changing the displayable format I am trying
OUTREC FIELDS=(7,3,ZD,TO=UFF,LENGTH=3)
But I am getting an error with UFF, saying “operand definer error”.
For converting 16 bytes to 11 bytes i used
OUTREC FIELDS=(1,17,18,16,ZD,EDIT=(TTTTTTTTTTT))
Back to top
Bill Woodger Moderator Emeritus Joined: 09 Mar 2011Posts: 7309 Location: Inside the Matrix
Can you convert to UFF? How would that work? Convert to a "Free Format", what would be the rules? Just use a similar mask as elsewhere, and be aware that you could be truncating values.
Back to top
Skolusu Senior Member Joined: 07 Dec 2007Posts: 2205 Location: San Jose
Nitin Bhargava wrote:
Thanks all.
I used folowing steps earlier:
SORT FIELDS=COPY
OUTREC FIELDS= (1:C’C’,2:1,799)
For changing the displayable format I am trying
OUTREC FIELDS=(7,3,ZD,TO=UFF,LENGTH=3)
But I am getting an error with UFF, saying “operand definer error”.
For converting 16 bytes to 11 bytes i used
OUTREC FIELDS=(1,17,18,16,ZD,EDIT=(TTTTTTTTTTT))
Use the following DFSORT Control cards. This will create 795 byte output file.
Code:
//SYSIN DD *
OPTION COPY
OUTREC BUILD=(C'C',1,6,7,3,ZD,EDIT=(TTT),10,8,
18,16,ZD,M11,LENGTH=11,35,766)
//*
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
Quote:
For changing the displayable format I am trying
OUTREC FIELDS=(7,3,ZD,TO=UFF,LENGTH=3)
But I am getting an error with UFF, saying “operand definer error”.
TO=UFF is NOT supported. With DFSORT, you could use TO=ZD or TO=ZDF to get F for the plus sign.
Back to top
Nitin Bhargava New User Joined: 22 May 2012Posts: 32 Location: india
Thanks everyone it worked
Back to top
Please enable JavaScript!