Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
expand a binary field from half word to full using syncsort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: expand a binary field from half word to full using syncsort
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    Post subject:
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 Moderator


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

PostPosted: Sat Jan 24, 2009 2:00 am    Post subject:
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:

www.ibm.com/systems/support/storage/software/sort/mvs/srtmpub.html

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    Post subject:
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 Moderator


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

PostPosted: Sat Jan 24, 2009 4:59 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to include a particular field val... sakrat DFSORT/ICETOOL 8 Fri Apr 06, 2018 8:27 pm
No new posts Reformatting and adding additional fi... Badbeef SYNCSORT 6 Thu Apr 05, 2018 4:45 pm
No new posts converting a mainframe file with ASA ... Lynne Schuler All Other Mainframe Topics 5 Wed Apr 04, 2018 9:44 am
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Searching a table for the field name? socker_dad COBOL Programming 8 Sat Mar 31, 2018 2:57 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us