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

Padding zeroes in a signed comp-3 field


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

Active User


Joined: 14 Aug 2006
Posts: 198

PostPosted: Wed Sep 26, 2007 3:18 pm
Reply with quote

Hi,

I got a requirement as follows. To pad zeroes in a field with following defintion.
Code:
AMT               PIC S9(6)V99  COMP-3.
Field is at position 3462.

Condition is that location 2562 should have value A for padding.

I used a following sort card.

Code:
OPTION COPY                                                         
INREC IFTHEN=(WHEN=(2562,1,CH,EQ,C'A'),                           
              BUILD=(1,3461,3462:4Z,3466:X'0C',3467,1533))         
OUTFIL IFOUTLEN=5000     


Quote:
I am using SYNCSORT 1.2.2.2R.


Unfortunately I dont have manual for this release. I have for 1.2.0, which does not have IFTHEN.

As you can see I cheated to include sign C in the last nibble at positio 3466. Can any body suggest a straight forward methord. Sort card I mentioned is working fine. I but I like to have decent one.

Thanks,
Abin.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Sep 26, 2007 3:33 pm
Reply with quote

First off, won't add the X'0C' to the end imbed the original sign into the middle of the number? Sort of like 01234c0c?
If you contact Syncsort, they can provide you with the documentation you need....From a prior post:
Quote:
Get the manuals, it is not that difficult.....
Quote:
Unfortunately, all licensed SyncSort customers must request manuals directly from us, or download it from our website using an online support account. It is in breach of contract for an individual to share SyncSort documentation with others outside of their own company. However, please feel free to pass on my contact info to anyone who is in need of manuals and I would be happy to assist.
Regards,
Alissa
Alissa Margulies
SyncSort Mainframe Support
201.930.8260
zos_tech@syncsort.com

and:
Alissa Margulies wrote:
dick scherrer wrote:
Which Syncsort publication has the writeup for IFTHEN? My downloaded doc does not have IFTHEN.

Hi Dick,

The SyncSort for z/OS 1.2 Addendum contains the BUILD, IFTHEN, IFOUTLEN, and OVERLAY Parameters.

If you have a SyncSort Online Customer Support Account, you can download the file named "SyncSort 1.2 Programmers Guide Add.pdf"

Regards,
Back to top
View user's profile Send private message
abin

Active User


Joined: 14 Aug 2006
Posts: 198

PostPosted: Wed Sep 26, 2007 3:43 pm
Reply with quote

Hi,

Quote:
First off, won't add the X'0C' to the end imbed the original sign into the middle of the number? Sort of like 01234c0c?


Don't think so. An input as following
Code:
00000   
0020C
Became as follows.
Code:
00000
0000C


Thanks,
Abin
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Sep 26, 2007 4:06 pm
Reply with quote

Ah, overlay rather than append....
But how is the 0C overlaying the 2000C?
Ah, the 4Z?
Why not just overlay the entire field with a PD zero?
Back to top
View user's profile Send private message
abin

Active User


Joined: 14 Aug 2006
Posts: 198

PostPosted: Wed Sep 26, 2007 4:22 pm
Reply with quote

Quote:
Why not just overlay the entire field with a PD zero?


You mean use
Code:
3462:5Z
instead of
Code:
3462:4Z,3466:X'0C'


Ah the problem is the result will be like
Code:
00000
00000
which is invalid in a signed PD field. The last nibble which is the sign is what made me cheat the card.

Any other way of doing it straight without making confsuion?

Thanks,
Abin
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Sep 26, 2007 4:44 pm
Reply with quote

No, something more like
3462:4,PD,+0......?
Is that valid?
Back to top
View user's profile Send private message
abin

Active User


Joined: 14 Aug 2006
Posts: 198

PostPosted: Wed Sep 26, 2007 5:07 pm
Reply with quote

Nope getting an error

Code:
BUILD=(1,3461,3462:4,PD,+0,3467,1534))   
                    *       


Some thing like below card does the work, provided we get an abend if field 3462,5 contains an invalid PD value, which will happen in my case. Also sign nibble remains constant. If it's a D, remains a D, when I need C there.

Code:
BUILD=(1,3461,3462,5,PD,MUL,+0,PD,LENGTH=5,3467,1534)) 


Thanks,
abin
Back to top
View user's profile Send private message
abin

Active User


Joined: 14 Aug 2006
Posts: 198

PostPosted: Wed Sep 26, 2007 5:24 pm
Reply with quote

Hi CICS GUY,

Quote:
No, something more like
3462:4,PD,+0......?
Is that valid?


I think you meant something like this.

Code:
3462:+0,TO=PD,LENGTH=5
This works, problem sign nibble contains F instead of C. I think F and C means +, correct? Is there any possibillity of problems arising from this. In normal COBOL when we create COMP-3 it contains C.

Thanks,
Abin.
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 Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Remove leading zeroes SYNCSORT 4
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts Join 2 files according to one key field. JCL & VSAM 3
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
Search our Forums:

Back to Top