Hi All,
I am trying to pull data from a file with delimiter (;).
I could achieve this by using-
INREC PARSE=(%00=(ENDBEFR=C';',FIXLEN=8),%02=(FIXLEN=10)),
BUILD=(%00,%02)
Input-
X1234567;08/03/2023
Output-
X123456708/03/2023
Now I need to add, preceding zero to the first column, to make it of length 16-
for this I tried using
BUILD=(%00,UFF,M11,LENGTH=16,%02)
But as its alphanumeric filed the first byte is ignored-
Input-
X1234567;08/03/2023
X124123;08/03/2023
Output-
000000000123456708/03/2023
000000000012412308/03/2023
Exptect output-
00000000X123456708/03/2023
000000000X12412308/03/2023
Can someone guide me on this?
sort card to add zeros to varying alphanumeric field.
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: sort card to add zeros to varying alphanumeric field.
PLEASE!!!!!!
Learn how to format your messages, to allow other to understand something
You need simple thing, like this
Learn how to format your messages, to allow other to understand something
longfall wrote:Hi All,
I am trying to pull data from a file with delimiter (;).
I could achieve this by using-Code: Select all
INREC PARSE=(%00=(ENDBEFR=C';',FIXLEN=8),%02=(FIXLEN=10)),
BUILD=(%00,%02)
Input-Code: Select all
X1234567;08/03/2023
Output-Code: Select all
X123456708/03/2023
Now I need to add, preceding zero to the first column, to make it of length 16-
for this I tried usingCode: Select all
BUILD=(%00,UFF,M11,LENGTH=16,%02)
But as its alphanumeric filed the first byte is ignored-
Input-Code: Select all
X1234567;08/03/2023
X124123;08/03/2023
Output-Code: Select all
000000000123456708/03/2023
000000000012412308/03/2023
Exptect output-Code: Select all
00000000X123456708/03/2023
000000000X12412308/03/2023
Can someone guide me on this?
You need simple thing, like this
Code: Select all
INREC PARSE=(%00=(ENDBEFR=C';',FIXLEN=8),%02=(FIXLEN=10)),
BUILD=(%00,JFY=(SHIFT=RIGHT,LENGTH=16,LEAD=C'000000000000'),
%02)
Javas and Pythons come and go, but JCL and SORT stay forever.
-
- Similar Topics
- Replies
- Views
- Last post
-
- 1
- 1928
-
by NicC
View the latest post
Sun Sep 06, 2020 5:10 pm
-
-
Parsing more than 1000 columns in a sort card Reply with quo
by ssuthagar » Tue Sep 22, 2020 3:02 am » in Syncsort/Synctool - 1
- 3434
-
by sergeyken
View the latest post
Tue Sep 22, 2020 9:06 pm
-
-
- 1
- 1753
-
by sergeyken
View the latest post
Fri Mar 26, 2021 11:59 pm
-
-
COBOL SORT - How to sort entire file first & sort by Key
by k_ekam » Thu Dec 01, 2022 12:58 pm » in IBM Cobol - 3
- 1529
-
by Robert Sample
View the latest post
Wed Dec 07, 2022 7:32 am
-
-
- 3
- 1986
-
by jcdm
View the latest post
Thu Aug 18, 2022 1:25 pm