Sort AlphaNumeric to Numeric

Unicenter CA-Easytrieve Plus Report Generator: CA's information retrieval and data management tool
mvtc19
Posts: 3
Joined: Tue Oct 30, 2018 2:46 am
Skillset: COBOL, DB2, JCL, SQL
Referer: Colleague

Sort AlphaNumeric to Numeric

Postby mvtc19 » Thu Nov 01, 2018 12:21 am

Hi,

I have an input file that have a length of 15, data type numeric.

Code: Select all

----+----1----+----2
********************
1234513961848      
********************
 


My EZT code is evaluating it as below, appending trailing zeroes.

Code: Select all

----+----1----+----2
********************
123451396184800      
********************
 


How do I sort my input file so that it'll be read as

Code: Select all

----+----1----+----2
********************
001234513961848      
********************
 

Robert Sample
Global moderator
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
Referer: other forum
Location: Dubuque, Iowa, USA

Re: Sort AlphaNumeric to Numeric

Postby Robert Sample » Thu Nov 01, 2018 4:23 am

Assuming "EZT code" means "Easytrieve code", WHY DO YOU WANT US TO GUESS HOW YOU CODED THE INPUT? We should not have to guess what you did -- if you cannot tell us, we cannot help you. It appears -- and this is only a guess -- that you are defining the Easytrieve variable as 15 bytes, the data is 13 bytes so Easytrieve is appending 2 zeroes to the value to replace the blanks. Have you read in the manual about how Easytrieve handles short variables or blanks in variables? If not -- start there. If you have, have you applied what you read to your problem?

And how exactly does your title "Sort AlphaNumeric to Numeric" apply to your problem statement? It does not even appear you are sorting anything at this point!

NicC
Global moderator
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Skillset: JCL, PL/1, Rexx, Utilities and to a lesser extent (i.e. I have programmed using them) COBOL,DB2,IMS
Referer: Google
Location: Pushing up the daisies (almost)

Re: Sort AlphaNumeric to Numeric

Postby NicC » Sat Nov 03, 2018 3:02 pm

Neither Sort nor Easytrieve are JCL. Moving to Easytrieve.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic


  • Similar Topics
    Replies
    Views
    Last post