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
 
Extend the file to add ZD fields using SYNCSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Extend the file to add ZD fields using SYNCSORT
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    Post subject: Reply to: Extend the file to add ZD fields using SYNCSORT
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    Post subject: Re: Reply to: Extend the file to add ZD fields using SYNCSOR
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    Post subject:
Reply with quote

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

Site Director


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

PostPosted: Thu Apr 29, 2010 1:14 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Thu Apr 29, 2010 3:24 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Tue May 04, 2010 2:10 am    Post subject: Reply to: Extend the file to add ZD fields using SYNCSORT
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    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 Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am

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