i have strings in my file which are right justified.i want to make them left justified..
how can i do that..
how to left justify strings in a file.
-
- Posts: 21
- Joined: Mon Jul 07, 2008 3:24 pm
- Skillset: cics,jcl,db2,cobol,vsam,dfsort/icetool
- Referer: manager
- dick scherrer
- Global moderator
- Posts: 6268
- Joined: Sat Jun 09, 2007 8:58 am
Re: how to left justify strings in a file.
Hello,
Please post a few examples of your existing data and what you want for the output. If there are multiple strings in the same record, show this also.
Please post a few examples of your existing data and what you want for the output. If there are multiple strings in the same record, show this also.
Hope this helps,
d.sch.
d.sch.
-
- Posts: 21
- Joined: Mon Jul 07, 2008 3:24 pm
- Skillset: cics,jcl,db2,cobol,vsam,dfsort/icetool
- Referer: manager
Re: how to left justify strings in a file.
say we have a file in which 2 fields are present.
product cost
abc 24.00
def 35.50
here in case of numeric data type all the digits are right justified.
we want to make them rigth jaustified..
how can it be done.
sorry i mentioned string previously.
product cost
abc 24.00
def 35.50
here in case of numeric data type all the digits are right justified.
we want to make them rigth jaustified..
how can it be done.
sorry i mentioned string previously.
- dick scherrer
- Global moderator
- Posts: 6268
- Joined: Sat Jun 09, 2007 8:58 am
Re: how to left justify strings in a file.
Hello,
To do what you want you could count (tally) the leading spaces in each amount and then using reference modification create a left-justified value. The length of the reference modified move would be the length of the amount field minus the leading spaces.
Not to worrysorry i mentioned string previously.

Left maybe? Tough day on the keyboardwe want to make them rigth jaustified..

To do what you want you could count (tally) the leading spaces in each amount and then using reference modification create a left-justified value. The length of the reference modified move would be the length of the amount field minus the leading spaces.
Hope this helps,
d.sch.
d.sch.
-
- Posts: 21
- Joined: Mon Jul 07, 2008 3:24 pm
- Skillset: cics,jcl,db2,cobol,vsam,dfsort/icetool
- Referer: manager
Re: how to left justify strings in a file.
thanks for above information but will you please explain it in the form of code.
-
- Posts: 62
- Joined: Wed Apr 23, 2008 1:37 pm
- Skillset: Mainframe - JCL, COBOL, VSAM, DB2, REXX, CICS
- Referer: Internet Search
- Location: Chennai, India
- Contact:
Re: how to left justify strings in a file.
Hi supriya saraswat,
I have another suggestion.. please try this..
Move the amount field (edited) to alphanumeric as the alphanumeric is left justified.. Try this and let me know whether it worked...
Regards,
jayind
I have another suggestion.. please try this..
Move the amount field (edited) to alphanumeric as the alphanumeric is left justified.. Try this and let me know whether it worked...
Regards,
jayind
- dick scherrer
- Global moderator
- Posts: 6268
- Joined: Sat Jun 09, 2007 8:58 am
Re: how to left justify strings in a file.
Hello,
If not, it is best to test "solutions" before posting them. If yes, it would be good to post the definition variable fields used for the test.
Did you test this before posting?Move the amount field (edited) to alphanumeric as the alphanumeric is left justified..
If not, it is best to test "solutions" before posting them. If yes, it would be good to post the definition variable fields used for the test.
Hope this helps,
d.sch.
d.sch.
-
- Similar Topics
- Replies
- Views
- Last post
-
- 0
- 2235
-
by laksh0901
View the latest post
Mon Sep 30, 2024 5:10 pm
-
- 5
- 3688
-
by kanipriya2785
View the latest post
Tue Jun 21, 2022 9:32 pm
-
-
EZIOE004 Logical I/O error on file occurred reading VB file
by savitha_y » Mon Feb 15, 2021 7:54 pm » in CA-Easytrieve - 3
- 4970
-
by savitha_y
View the latest post
Wed Feb 17, 2021 5:02 am
-
-
-
File Handling 3 input files and 1 output file by using EZT
by pavan426 » Thu Sep 09, 2021 12:17 am » in CA-Easytrieve - 0
- 4434
-
by pavan426
View the latest post
Thu Sep 09, 2021 12:17 am
-
-
-
Need to check whether file is ESDS file or not by using REXX
by Devrana » Sat Oct 05, 2024 2:28 pm » in CLIST & REXX - 6
- 3278
-
by sergeyken
View the latest post
Tue Oct 08, 2024 5:25 pm
-