Replacing characters Using JCL
Moderators: Frank Yaeger, DikDude, Moderator Group
-
- Member
- Posts: 3
- Joined: Tue Jul 21, 2009 8:00 pm
Replacing characters Using JCL
Hi
I wanted to convert some specific set of characters to some other characters in the given dataset using JCL.is it possible to do ?
Like I have dataset File1 which can have some special character for example $ now i want to convert all the $ sign with S in the dataset also i have file 2 which consists of this special character mapped with the new character.
Can i do it using JCL.Its urgent Pls reply soon if someone have idea about this.
I wanted to convert some specific set of characters to some other characters in the given dataset using JCL.is it possible to do ?
Like I have dataset File1 which can have some special character for example $ now i want to convert all the $ sign with S in the dataset also i have file 2 which consists of this special character mapped with the new character.
Can i do it using JCL.Its urgent Pls reply soon if someone have idea about this.
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
It's not clear what you want to do.
Please show an example of the records in each input file and what you expect for output. Explain the "rules" for getting from input to output. Give the RECFM and LRECL of the input file. Give the starting position, length and format of all relevant fields.
Please show an example of the records in each input file and what you expect for output. Explain the "rules" for getting from input to output. Give the RECFM and LRECL of the input file. Give the starting position, length and format of all relevant fields.
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
-
- Member
- Posts: 3
- Joined: Tue Jul 21, 2009 8:00 pm
Ok..I will explain you with an example here.
Let say i have a file having record layout as follows:
1)Name pic X(10)
2)Address Pic x(30)
3)Telephoneno 9(10)
4)Profession x(10)
5)ISNno X(10)
Now i have created a dataset using a program.Now any of these fields can have some characters other than A-Z or 0-9 for example Name field can have a value as $id.
Now I have one more dataset which as record layout as follows:
1)Special char PIC X(1)
2)Actual char PIC X(1)
Now this file give me the corresponding character which should replace the special char from first file.
For example above I have given an example that Name field can have value $id.Now I have to replace this $ with some other value which is defined in file 2.
Likewise i have to it for all such special character appearing in my file1 with cooresponding character defined in file2.
Let say i have a file having record layout as follows:
1)Name pic X(10)
2)Address Pic x(30)
3)Telephoneno 9(10)
4)Profession x(10)
5)ISNno X(10)
Now i have created a dataset using a program.Now any of these fields can have some characters other than A-Z or 0-9 for example Name field can have a value as $id.
Now I have one more dataset which as record layout as follows:
1)Special char PIC X(1)
2)Actual char PIC X(1)
Now this file give me the corresponding character which should replace the special char from first file.
For example above I have given an example that Name field can have value $id.Now I have to replace this $ with some other value which is defined in file 2.
Likewise i have to it for all such special character appearing in my file1 with cooresponding character defined in file2.
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
Please run the following job and show me the messages you receive in //SYSOUT so I can see which sort product you're using and what level it's at:
Code: Select all
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
RECORD 1
//SORTOUT DD DUMMY
//SYSIN DD *
OPTION COPY
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
-
- Member
- Posts: 3
- Joined: Tue Jul 21, 2009 8:00 pm
Hi i am getting following output in sysout
ICE143I 0 BLOCKSET COPY TECHNIQUE SELECTED
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 08:07 ON THU JUL
OPTION COPY
ICE201I E RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE751I 0 C5-K26318 C6-K90007 C7-K90000 C8-K23476 E9-K90007 C9-BASE E5-K35433
ICE193I 0 ICEAM1 ENVIRONMENT IN EFFECT - ICETD1 INSTALLATION MODULE SELECTED
ICE088I 0 SC1020S .S1 . , INPUT LRECL = 80, BLKSIZE = 80, TYPE = FB
ICE093I 0 MAIN STORAGE = (MAX,6291456,6278238)
ICE156I 0 MAIN STORAGE ABOVE 16MB = (6200798,6200798)
ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y,
ICE128I 0 OPTIONS: SIZE=6291456,MAXLIM=2097152,MINLIM=524288,EQUALS=N,LIST=Y,ERE
ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=SHORT,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT=
ICE130I 0 OPTIONS: RESALL=12288,RESINV=0,SVC=109 ,CHECK=Y,WRKREL=Y,OUTREL=Y,CKPT
ICE131I 0 OPTIONS: TMAXLIM=6291456,ARESALL=0,ARESINV=0,OVERRGN=65536,CINV=Y,CFW=
ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE ,EXITC
0 OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=MAX ,ODMAXBF=0,SOLRF=Y,VLLONG=N,VSAMI
0 OPTIONS: NULLOUT=RC0
0 BSAM ACCESS METHOD USED FOR SORTOUT
0 BSAM ACCESS METHOD USED FOR SORTIN
1 EF-K10929 F0-K30362 E8-K24705
0 OUTPUT LRECL = 80, BLKSIZE = 80, TYPE = FB
0 INSERT 0, DELETE 0
0 RECORDS - IN: 1, OUT: 1
0 END OF DFSORT
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 08:07 ON THU JUL
OPTION COPY
ICE201I E RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE751I 0 C5-K26318 C6-K90007 C7-K90000 C8-K23476 E9-K90007 C9-BASE E5-K35433
ICE193I 0 ICEAM1 ENVIRONMENT IN EFFECT - ICETD1 INSTALLATION MODULE SELECTED
ICE088I 0 SC1020S .S1 . , INPUT LRECL = 80, BLKSIZE = 80, TYPE = FB
ICE093I 0 MAIN STORAGE = (MAX,6291456,6278238)
ICE156I 0 MAIN STORAGE ABOVE 16MB = (6200798,6200798)
ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y,
ICE128I 0 OPTIONS: SIZE=6291456,MAXLIM=2097152,MINLIM=524288,EQUALS=N,LIST=Y,ERE
ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=SHORT,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT=
ICE130I 0 OPTIONS: RESALL=12288,RESINV=0,SVC=109 ,CHECK=Y,WRKREL=Y,OUTREL=Y,CKPT
ICE131I 0 OPTIONS: TMAXLIM=6291456,ARESALL=0,ARESINV=0,OVERRGN=65536,CINV=Y,CFW=
ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE ,EXITC
0 OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=MAX ,ODMAXBF=0,SOLRF=Y,VLLONG=N,VSAMI
0 OPTIONS: NULLOUT=RC0
0 BSAM ACCESS METHOD USED FOR SORTOUT
0 BSAM ACCESS METHOD USED FOR SORTIN
1 EF-K10929 F0-K30362 E8-K24705
0 OUTPUT LRECL = 80, BLKSIZE = 80, TYPE = FB
0 INSERT 0, DELETE 0
0 RECORDS - IN: 1, OUT: 1
0 END OF DFSORT
- 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=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... replace file (FB)
//SORTOUT DD DSN=&&C1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
INREC BUILD=(3:1,1,HEX,2,1,HEX,C',',80:X)
//S2 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... name file (FB/70)
//SORTOUT DD DSN=... output file (FB/70)
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(1,70,TRAN=ALTSEQ)
ALTSEQ CODE=(C1C1,
/*
// DD DSN=&&C1,DISP=(OLD,PASS)
// DD *
C1C1)
/*
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