Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Sort to insert character ‘C’ in first byte

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Sort to insert character ‘C’ in first byte
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    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue May 29, 2012 3:04 pm    Post subject: Reply to: Sort
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    Post subject: Re: Reply to: Sort
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    Post subject:
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue May 29, 2012 3:48 pm    Post subject: Reply to: Sort
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    Post subject:
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 Moderator


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

PostPosted: Tue May 29, 2012 11:01 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us