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

Sort to insert character ‘C’ in first byte


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Nitin Bhargava

New User


Joined: 22 May 2012
Posts: 32
Location: india

PostPosted: Tue May 29, 2012 2:29 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue May 29, 2012 2:39 pm
Reply with quote

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
View user's profile Send private message
kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Tue May 29, 2012 2:41 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue May 29, 2012 3:04 pm
Reply with quote

please use intelligent titles ! icon_evil.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue May 29, 2012 3:11 pm
Reply with quote

enrico-sorichetti wrote:
please use intelligent titles ! icon_evil.gif


TS probably needs someone to share one with him.
Back to top
View user's profile Send private message
Biswajit D

New User


Joined: 17 Apr 2012
Posts: 50
Location: India

PostPosted: Tue May 29, 2012 3:13 pm
Reply with quote

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
View user's profile Send private message
Nitin Bhargava

New User


Joined: 22 May 2012
Posts: 32
Location: india

PostPosted: Tue May 29, 2012 3:42 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue May 29, 2012 3:48 pm
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue May 29, 2012 9:53 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue May 29, 2012 11:01 pm
Reply with quote

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
View user's profile Send private message
Nitin Bhargava

New User


Joined: 22 May 2012
Posts: 32
Location: india

PostPosted: Mon Jun 04, 2012 12:20 pm
Reply with quote

Thanks everyone it worked
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts 10 byte RBA conversion DB2 2
Search our Forums:

Back to Top