ALTSEQ statement
Moderators: Frank Yaeger, Moderator Group
ALTSEQ statement
Hi,
I have a querry regarding ALTSEQ statement.
My input looks like this
----+----1----+----2----+
-00000-00000USD2..
-00000-00000USD...
When I used ALTSEQ statement, all the undisplayable characters i.e. ( all '.' ) were replaced by spaces and I got the o/p as
----+----1----+----2----+
-00000-00000USD2
-00000-00000USD
But my requirement is whenever there is undisplayble character, the entire field which contains that character should be replaced by spaces.
For ex.
if input is PA.HELI123456
then
output should be bbbbbbb123456----(expected output)
instead of PAbHELI123456----(output currently getting)
where '.' = undisplayable character
and 'b' = blank or space
I have a querry regarding ALTSEQ statement.
My input looks like this
----+----1----+----2----+
-00000-00000USD2..
-00000-00000USD...
When I used ALTSEQ statement, all the undisplayable characters i.e. ( all '.' ) were replaced by spaces and I got the o/p as
----+----1----+----2----+
-00000-00000USD2
-00000-00000USD
But my requirement is whenever there is undisplayble character, the entire field which contains that character should be replaced by spaces.
For ex.
if input is PA.HELI123456
then
output should be bbbbbbb123456----(expected output)
instead of PAbHELI123456----(output currently getting)
where '.' = undisplayable character
and 'b' = blank or space
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
What control statements did you use to get the current output?
What control statements did you use to get the current output?
What exactly is the programmable definition of the "entire field"? In your example, PA.HELI123456 are just characters ... what makes PA.HELI an "entire field"? Are the fields fixed length, or delimited in some way, or what?But my requirement is whenever there is undisplayble character, the entire field which contains that character should be replaced by spaces.
What control statements did you use to get the current output?
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Hi Frank
Thanks for your quick reply. Please find the explanation for the stated problem below, For example:- My input is like this,
Now I wrote a jcl to replace undisplayable char say ? if any from EMPLOYEE-CODE field with spaces
Thus I got the output as,
but I want the output in following way,
that means if the undisplayable char is present at any of the position then i want ALTSEQ to replace not only that char at that position but also all the positions. Hope this much info is helpfull to you to guide me in a proper way.
Thanks in advance.
Thanks for your quick reply. Please find the explanation for the stated problem below, For example:- My input is like this,
Code: Select all
EMPLOYEE- EMPLOYEE-CODE
NAME
5/AN 5/AN
(1-5) (6-10)
1------------ 2------------
***************************
GIRI3 11111
GIRI2 22??2
GIRI1 33333
GIRI5 44444
GIRI4 5???5
***************************
Code: Select all
//SYSIN DD *
SORT FIELDS=COPY
ALTSEQ CODE=(6F40)
OUTREC FIELDS=(1,5,
6,5,TRAN=ALTSEQ)
/*
Code: Select all
EMPLOYEE- EMPLOYEE-CODE
NAME
5/AN 5/AN
(1-5) (6-10)
1------------ 2------------
***************************
GIRI0 11111
GIRI1 22 2
GIRI2 33333
GIRI3 44444
GIRI4 5 5
***************************
Code: Select all
EMPLOYEE- EMPLOYEE-CODE
NAME
5/AN 5/AN
(1-5) (6-10)
1------------ 2------------
***************************
GIRI0 11111
GIRI1
GIRI2 33333
GIRI3 44444
GIRI4
***************************
Thanks in advance.
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
Here's a DFSORT job that will do what you asked for:
Code: Select all
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
GIRI311111
GIRI222??2
GIRI133333
GIRI544444
GIRI45???5
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=(6,5,SS,EQ,C'?'),
OVERLAY=(6:6X))
/*
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Paheli,
You can try this File-Aid solution also.....
HTH.
You can try this File-Aid solution also.....
Code: Select all
//STEP01 EXEC PGM=FILEAID
//SYSUDUMP DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSLIST DD SYSOUT=*
//SYSTOTAL DD SYSOUT=*
//DD01 DD *
GIRI311111
GIRI222??2
GIRI133333
GIRI544444
GIRI45???5
//DD01O DD SYSOUT=*
//SYSIN DD *
$$DD01 COPY REPL=(1,EQ,X'00',X'FF')
//*
========
Ranga...:-0)
========
Learn Which You Don't Know - Teach Others Which They Don't Know.
Ranga...:-0)
========
Learn Which You Don't Know - Teach Others Which They Don't Know.
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
how to apply this logic to replace null values instead of spaces?
If you want to put 6 binary zeros in the field, you can use 6X'00' or 6Z instead of 6X.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
Ranga,
That FileAid job DOES NOT do what the OP asked for. It only replaces a X'00' in the first byte with X'FF'. If you'd bothered to test it with the OP's data, you would have figured that out.
Please don't post FileAid solutions in the DFSORT Forum (there's a separate Forum for people who want FileAid solutions), especially FileAid solutions that aren't even solutions for the problem given.
That FileAid job DOES NOT do what the OP asked for. It only replaces a X'00' in the first byte with X'FF'. If you'd bothered to test it with the OP's data, you would have figured that out.
Please don't post FileAid solutions in the DFSORT Forum (there's a separate Forum for people who want FileAid solutions), especially FileAid solutions that aren't even solutions for the problem given.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page