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

Extend the file to add ZD fields using SYNCSORT


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

New User


Joined: 07 Dec 2003
Posts: 56
Location: Montreal

PostPosted: Wed Apr 28, 2010 10:07 pm
Reply with quote

Hi,

I need to extend the file with rec. length 490 to add 2 new fields in the end with picture clause as PIC S9(07)V99. The output file should have the record length as 508 with two new fields initialized to zero.

Can someone please suggest the Control Statement for SYNCSORT to accomplish this?

Thank you
-Manohar
Back to top
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 183
Location: hyderabad

PostPosted: Thu Apr 29, 2010 12:00 am
Reply with quote

manoopatil,
I think,you want to add 18 zeroes at the end of the input record.

Code:

sort fields=copy
outrec fields=(1,490,c'000000000',c'000000000')


The above card shoud give the desired output.

Thanks
Krishy
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Apr 29, 2010 12:27 am
Reply with quote

sril.krishy wrote:
manoopatil,
I think,you want to add 18 zeroes at the end of the input record.

Code:

sort fields=copy
outrec fields=(1,490,c'000000000',c'000000000')


The above card shoud give the desired output.

Thanks
Krishy


Since when are PIC 9(07)V99 and PIC S9(07)V99 the same?
Back to top
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 183
Location: hyderabad

PostPosted: Thu Apr 29, 2010 12:39 am
Reply with quote

Sorry!it's a mistake!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Apr 29, 2010 1:14 am
Reply with quote

Hello,

Given that the new fields appear to be amounts or quantities and that they are zeros, the posted code should work. . .

It should be noted that this inserts data with an "implied positive" value due to the "F" sign (rather than an explicit positive ("C" sign) or an explicit negative ("D" sign).
Back to top
View user's profile Send private message
manoopatil

New User


Joined: 07 Dec 2003
Posts: 56
Location: Montreal

PostPosted: Thu Apr 29, 2010 1:26 am
Reply with quote

Thanks you Krishy,

However picture clause for new fields is - PIC S9(07)V99 which is not Alphabetic or Alphanumeric. Will that cause an issue when the program try to read these fields initialized to zeroes but having picture clause PIC S9(07)V99

Thank you
-Manohar
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Apr 29, 2010 3:24 am
Reply with quote

Hello,

To repeat:
Quote:
Given that the new fields appear to be amounts or quantities and that they are zeros, the posted code should work. . .


Did you try this? If not, why not? That is why we test. . .

Quote:
However picture clause for new fields is - PIC S9(07)V99
Suggest you read about which values are valid for a field with this picture. You can read about this in the COBOL Language Reference available via the "IBM Manuals" link at the top of the page. . .

You need to learn about signed values (the s9 means signed). They will be with you as long as you work with computers.
Back to top
View user's profile Send private message
manoopatil

New User


Joined: 07 Dec 2003
Posts: 56
Location: Montreal

PostPosted: Tue May 04, 2010 2:03 am
Reply with quote

Hi Dick,

Thanks for the advice. I did try krishy's suggestion and it did work.

Additionally I also tried following alternate solution and that also works.

Code:
sort fields=copy
outrec fields=(1,490,c'00000000{',c'00000000{')


Thank you everybody for posting your suggestions

Regards
-Manohar
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue May 04, 2010 2:10 am
Reply with quote

Good to hear it is working - thank you for letting us know icon_smile.gif

d
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 FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top