View previous topic :: View next topic
|
Author |
Message |
Shrikant Kumar
New User
Joined: 15 Jul 2014 Posts: 2 Location: India
|
|
|
|
I have a file that is present in the following format
Header Record
Detail Record - 1
Detail Record - 2
Detail Record- 3
Trailer Record
In the Trailer Record I am taking in the count of total number of records present which in the above case works out to 3.
I have a requirement to update the number of records on file in the Trailer record which i am completing by making use of the IFTRAIL and TRLUPD functions.
I have my sortcard as below
Code: |
OPTION COPY
OUTFIL FNAMES=OUT12,
IFTRAIL=(HD=YES,TRLID=(1,2,ZD,EQ,+9),
TRLUPD=(14:COUNT=(M11,LENGTH=4)))
|
Now, my problem is that the Output COUNT that appears should be an Signed value.
For Example: if the count of records comes out to 4 then i want it represented in the Trailer as 0004F. I want the Sign bit as well to show if it's positive or negative. I realise that the count of records will always be Positive but i still have to display that Sign bit.
Please let me know how this can be achieved in TRLUPLD part itself.
Thank You,
Healy
Duplicate in Students and Beginners |
|
Back to top |
|
|
Shrikant Kumar
New User
Joined: 15 Jul 2014 Posts: 2 Location: India
|
|
|
|
Hello,
For those interested I solved the problem and am posting the solution
Code: |
OUTFIL FNAMES=OUT12,
IFTRAIL=(HD=YES,TRLID=(1,1,ZD,EQ,+9),
TRLUPD=(7:COUNT=(TO=ZDC,LENGTH=4)))
|
|
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
Thats right.. and this would help. |
|
Back to top |
|
|
|