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

expand a binary field from half word to full using syncsort


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
raja1128

New User


Joined: 09 Jan 2007
Posts: 17
Location: india

PostPosted: Fri Jan 23, 2009 4:49 am
Reply with quote

hi all,

I need to expand a file by two bytes.
here are the details...

file is fixed block with length 36.
fileld type is PIC S9(04) COMP
field starts at byte 21.

I have to make the field to PIC S9(08) COMP and retain the value.

kindly give me the sort card for this...and manual too

thanks in advance..
Back to top
View user's profile Send private message
raja1128

New User


Joined: 09 Jan 2007
Posts: 17
Location: india

PostPosted: Sat Jan 24, 2009 1:12 am
Reply with quote

is there a way with DFSORT for the same??


thanks...
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: Sat Jan 24, 2009 2:00 am
Reply with quote

Your Subject says "using Syncsort" so why are you asking for a DFSORT solution? Which product are you using.

PIC S9(04) is a 2-byte value. PIC S9(08) is a 4-byte value. If the values are unsigned (e.g. X'FFFF' = 65535), then you'd just need to insert X'0000' on the left. If the values are signed (e.g. X'FFFF' = -1), then you'd have to insert X'0000' on the left for positive values or X'FFFF' on the left for negative values. So you need to indicate whether the values are unsigned or signed.

Either way, you need to insert 2 bytes, so you can either overlay the two bytes after the field, or move the bytes after the field to the right. Which do you want to do?

In the simplest case, if the values are unsigned and you just want to insert X'0000' before the field and increase the record length, you can use these DFSORT control statements:

Code:

   OPTION COPY
   INREC BUILD=(1,20,2X'00',21,16)


The DFSORT books are available at:

Use [URL] BBCode for External Links

But if you're using Syncsort, you'll need to get the books from Syncsort.
Back to top
View user's profile Send private message
raja1128

New User


Joined: 09 Jan 2007
Posts: 17
Location: india

PostPosted: Sat Jan 24, 2009 3:56 am
Reply with quote

thanks frank...

I figured it out. it is a positive field and inserted x'0000' (low values) on the left. actually inserting 2Z ( binary zeoes ) also does the same.
I have both syncsort and dfsort and am using syncsort.

here is the card i used...

SORT FIELDS=COPY
OUTFIL FILES=01,
OUTREC FIELDS=(1,20,X'0000',21,16)

thansk again...have a nice weekend.
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: Sat Jan 24, 2009 4:59 am
Reply with quote

Quote:
I figured it out.


Hmmm ... seems like I figured it out. icon_wink.gif

2Z, 2X'00' and X'0000' are all equivalent. Your choice.

You could use INREC, OUTREC or OUTFIL for this. Your choice.

In the future, since you have both products, please indicate which one you want the solution for and post in the appropriate Forum accordingly.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts VB to VB copy - Full length reached SYNCSORT 8
Search our Forums:

Back to Top