Page 1 of 1

Replacing characters Using JCL

Posted: Tue Jul 21, 2009 8:09 pm
by rachitsethcse
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.

Posted: Tue Jul 21, 2009 9:36 pm
by Frank Yaeger
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.

Posted: Wed Jul 22, 2009 10:48 am
by rachitsethcse
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.

Posted: Wed Jul 22, 2009 7:51 pm
by Frank Yaeger
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

Hi i am getting following output in sysout

Posted: Thu Jul 23, 2009 11:10 am
by rachitsethcse
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

Posted: Thu Jul 23, 2009 9:46 pm
by Frank Yaeger
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)
/*

Topic deleted by Admin

Posted: Mon Feb 01, 2016 1:27 am
by academyindia4
<< Content deleted By Admin >>

Topic deleted by Admin

Posted: Wed Feb 03, 2016 12:41 am
by academyindia4
<< Content deleted By Admin >>