Hi all
My input record is like this
123456789 123456 123456789
Is it possible to add 4 leading zeroes to this record using INREC ?
ie I want the record as below
0000123456789 123456 123456789
Add leading zeroes to record
-
- Posts: 28
- Joined: Wed Sep 19, 2018 8:20 pm
- Skillset: CICS, HLASM, DFSORT, REXX, PL/1
- Referer: Self-referred
Re: Add leading zeroes to record
Yes, assuming an 80 byte FB record:
adjust for your record type/length.
Garry.
Code: Select all
INREC BUILD=(1:C'0000',1,80)
adjust for your record type/length.
Garry.
Re: Add leading zeroes to record
Thanks Garry.
I tried this option but I am getting the below error :
INREC RECORD LENGTH=84
POTENTIALLY INEFFICIENT USE OF INREC
OUTREC RECORD LENGTH=84
SORTOUT HAS INCOMPATIBLE LRECL
I tried this option but I am getting the below error :
INREC RECORD LENGTH=84
POTENTIALLY INEFFICIENT USE OF INREC
OUTREC RECORD LENGTH=84
SORTOUT HAS INCOMPATIBLE LRECL
-
- Posts: 28
- Joined: Wed Sep 19, 2018 8:20 pm
- Skillset: CICS, HLASM, DFSORT, REXX, PL/1
- Referer: Self-referred
Re: Add leading zeroes to record
What is your RECFM and LRECL ? Can you show the job (using the Code tags) ? Code tags are applied using the buttons above the screen where youre typing.
Garry
Garry
Re: Add leading zeroes to record
Hi Garry
The RECFM is FB and LRECL =80
[/code]
The RECFM is FB and LRECL =80
Code: Select all
OPTION COPY
INREC BUILD=(1:C'0000',1,80)
OUTREC IFTHEN=(WHEN=INIT,FINDREP=(STARTPOS=01,ENDPOS=13,SHIFT=NO,
INOUT = (C'0000123456789',C'345678912'))),
IFTHEN=(WHEN=INIT,FINDREP=(STARTPOS=01,ENDPOS=13,SHIFT=NO,
INOUT = (C'0000',C'222222222'))),
IFTHEN
[/code]
-
- Posts: 28
- Joined: Wed Sep 19, 2018 8:20 pm
- Skillset: CICS, HLASM, DFSORT, REXX, PL/1
- Referer: Self-referred
Re: Add leading zeroes to record
Those are your control cards, not the job - and now have OUTREC, which has nothing to do with your original question. Can you show the error messages you are getting?
Also, the syntax of the OUTREC statements looks wrong - what is INOUT = ? To start with, there should be no spaces and my SORT documentation shows both IN= and OUT= parameters, not a single INOUT= parameter.
In posting your question, you should specify what you expect as output at the end of processing - what I suggested gives exactly what you looked for without OUTREC processing in your original question.
Garry.
Also, the syntax of the OUTREC statements looks wrong - what is INOUT = ? To start with, there should be no spaces and my SORT documentation shows both IN= and OUT= parameters, not a single INOUT= parameter.
In posting your question, you should specify what you expect as output at the end of processing - what I suggested gives exactly what you looked for without OUTREC processing in your original question.
Garry.
-
- Posts: 28
- Joined: Wed Sep 19, 2018 8:20 pm
- Skillset: CICS, HLASM, DFSORT, REXX, PL/1
- Referer: Self-referred
Re: Add leading zeroes to record
Not to mention that you have multiple WHEN=INIT clauses - which is incorrect.
Garry.
Garry.
-
- Global moderator
- Posts: 3006
- Joined: Fri Apr 18, 2008 11:25 pm
- Skillset: tso,rexx,assembler,pl/i,storage,mvs,os/390,z/os,
- Referer: www.ibmmainframes.com
Re: Add leading zeroes to record
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
-
- Similar Topics
- Replies
- Views
- Last post
-
-
Using nice/renice commands on USS leading to MSG FSUMF022
by Marcels68 » Sat Oct 12, 2024 4:02 pm » in Operating Systems - 0
- 1811
-
by Marcels68
View the latest post
Sat Oct 12, 2024 4:02 pm
-
-
-
remove leading special chars, space & trailing special char
by srihemz » Tue Jun 30, 2020 8:06 pm » in DFSORT/ICETOOL/ICEGENER - 2
- 3865
-
by sergeyken
View the latest post
Wed Jul 01, 2020 4:55 pm
-
-
-
Copy partial record after a string in a record using SORT.
by Esmayeelhusen » Thu May 04, 2023 3:03 pm » in DFSORT/ICETOOL/ICEGENER - 16
- 4254
-
by Esmayeelhusen
View the latest post
Mon May 22, 2023 3:50 pm
-
-
- 2
- 1398
-
by PRDVCF
View the latest post
Thu Nov 17, 2022 9:58 pm
-
-
compare substring in the same record
by samb01 » Mon Jun 12, 2023 1:08 pm » in DFSORT/ICETOOL/ICEGENER - 10
- 2884
-
by sergeyken
View the latest post
Tue Jun 13, 2023 11:04 pm
-