I have the input file as follows:
Input file length is 80 and RECFM is FB. This file contains only one field which is of X(18). Now i need to extract only ALPHABETIC values to the output file using SORT CARD.
In COBOL, i can do that using ' IS ALPHABETIC' am not supposed to use COBOL program for this.
In forum, i found how to check NUMERIC but didn't find for ALPHABETIC.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
If you mean that you want to only include a record if EVERY character in that record is uppercase A-Z or blank, you can use a DFSORT job like the following:
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
From the sample data, yes, as far as it goes - first input line is blank, as is first output. Up to TS, I suppose, to come back if he doesn't want leading spaces followed by letters.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
I assumed leading, trailing and embedded spaces would be considered alphabetic. If that's not the case, then the OP will have to define what he wants more precisely.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Hi Gerry,
Very easily done, the blank line can become invisible when pondering the leading spaces. When I set out test data, I put "this line intentionally left blank". Personally I'd suspect that the TS thinks leading blanks are not possibile - however, data had to come from somewhere, usually leads back to data-entry at some point and he should want to know whether to include or not, which is where your question helps anyway.
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
Hi Bill,
from OP
Quote:
In COBOL, i can do that using ' IS ALPHABETIC' am not supposed to use COBOL program for this.
I'm no Cobol programmer, so I googled and found this
Quote:
In OS/VS COBOL, only uppercase letters and the space character were considered to be ALPHABETIC.
In Enterprise COBOL, uppercase letters, lowercase letters, and the space character are considered to be ALPHABETIC.
If your OS/VS COBOL program uses the ALPHABETIC class test, and the data tested consists of mixed uppercase and lowercase letters, there can be differences in execution results. In such cases, you can ensure identical results by substituting the Enterprise COBOL ALPHABETIC-UPPER class test for the OS/VS COBOL ALPHABETIC test.
Thank you all for your suggestions...
When i try to execute the code no records got selected..
Sorry for the confusion...SPACES are not required for the output.
My job log details:
Code:
WER164B 8,884K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 1,412K BYTES USED
WER146B 12K BYTES OF EMERGENCY SPACE ALLOCATED
WER108I SORTIN : RECFM=FB ; LRECL= 80; BLKSIZE= 80
WER110I SORTOUT : RECFM=FB ; LRECL= 80; BLKSIZE= 27920
WER410B 7,856K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LIN
WER410B 0 BYTES RESERVE REQUESTED, 1,284K BYTES USED
WER055I INSERT 0, DELETE 5
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
WER416B BSAM WAS USED FOR SORTIN
WER416B SORTOUT : EXCP'S=0,UNIT=3390,DEV=C78A,CHP=(B0B1B2B3B4B5B6,1)
WER054I RCD IN 5, OUT 0
WER169I RELEASE 1.3 BATCH 0492 TPF LEVEL 2.1
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
Hello,
Possibly - once we understand exactly what you want in total.
If you post the original input data including all cases and then show how you want each record handled (completely explain the rules - for example should a bunch of trailing spaces be ignored or should these cause records to be omitted?), someone will probably have a suggestion.
Please use the "Code" tag to preserve alignment and improve readability.