Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 9405

DFSORT/ICETOOL :: Syntax to check the first 4 digits of a number.

$
0
0
Author: kshirabdhi
Subject: Syntax to check the first 4 digits of a number.
Posted: Tue May 03, 2016 12:21 pm (GMT 5.5)

Hi All,

I am using SORT to fetch records from a file based on a condition.

Fields part of INCLUDE COND are -

Code:
 TRAN-CODE       PIC  9(05).   
 TRACE-NUMBER    PIC  9(11).   


Requirement -

Fetch records where
1. TRAN-CODE = 101 and
2. TRACE-NUMBER begins with 9954 OR 9568 (excluding the leading zeros)

Position of TRAN-CODE is 1 and TRACE-NUMBER is 7. Number of digits in TRACE-NUMBER can be from 5 to 11.

Input data -

Code:
00101 00000995412
00101 00995412234
00101 00090541274
00101 09568123421
00101 00956895412
00101 00956790989


Output -
Code:
00101 00000995412
00101 00995412234
00101 09568123421
00101 00956895412


I am unable to write the syntax for condition for TRACE-NUMBER. The reason why I am using SORT is , I am extracting data from a file for validation with a report after production implementation.

Please help if SORT has any function/syntax for this. Let me know if I need to furnish more details.


Viewing all articles
Browse latest Browse all 9405

Trending Articles