equivalent file-manager command of file-aid command COPYBACK
Moderators: Frank Yaeger, Moderator Group
equivalent file-manager command of file-aid command COPYBACK
My client is stopping use of file-aid, now they want us to use file-manager. We have been using following command in JCL for copying the last 5 records from input file, when the number of records in input file was unknown. Please see the below piece of code in file-aid:
//FILEAID1 EXEC PGM=FILEAID,REGION=1M,COND=(7,GE,CHKFILE)
//SYSPRINT DD SYSOUT=*
//SYSLIST DD SYSOUT=*
//DD01 DD DSN=ABC.TEMP,DISP=SHR
//DD01O DD DSN=&&TEST3,
// UNIT=TSTDA,SPACE=(CYL,(5,5),RLSE),DISP=(,PASS),
// DCB=*.DD01
//SYSIN DD *
$$DD01 COPYBACK OUT=05
/*
If anybody uses filemanager in jobs, Please help me. I tried to google, but to no avail
//FILEAID1 EXEC PGM=FILEAID,REGION=1M,COND=(7,GE,CHKFILE)
//SYSPRINT DD SYSOUT=*
//SYSLIST DD SYSOUT=*
//DD01 DD DSN=ABC.TEMP,DISP=SHR
//DD01O DD DSN=&&TEST3,
// UNIT=TSTDA,SPACE=(CYL,(5,5),RLSE),DISP=(,PASS),
// DCB=*.DD01
//SYSIN DD *
$$DD01 COPYBACK OUT=05
/*
If anybody uses filemanager in jobs, Please help me. I tried to google, but to no avail
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
FINDREP in sort
Hi All,
Please help me on the below issue.
Requirements:
In a file it has 4 fields. In these fields we may have special character’s like “ä, ö, ü and ß”. So we need to convert these special characters into “AU,OE,UE and SS”. Here we need to replace a single character with 2 character.
If we replace these, it should use the remaining spaces of the corresponding fields.
For an example:
Here the special character “ä” has to be changed as “AU”. This special character might come anywhere in the below fields. So We need to replace this without any displacement in the other fields. Since it should use the spaces which are available in the corresponding fields.it should not change the starting position of other fields.
Since every field is having some extra spaces, so OUTREC FINDREP should use these extra spaces while replacing it. Please help me on this.
Dept User id Name Area code
Code (10-35 length) (36-55 length) (56-69 length)
(1-9 length)
01 816 2138201656011656IM FANG IM FANG FR1 83320
01 817 2138101656001656JAUN JAUN FR1 83319
01 818 843201657001657ABLäNDSCHEN ABLäNDSCHEN BE1 83320
01 818 843201657001657ABLAUNDSCHEN ABLAUNDSCHEN BE1 83320
01 818 843201657001657ABLAUNDSCHEN ABLAUNDSCHEN BE1 83320
01 819 2126201654001654CERNIAT FR CERNIAT FR FR2 83320
Sort condition which I used:
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FINDREP=(INOUT=(C'ä',C'AE',C'ö',C'OE',
C'ü',C'UE',C'ß',C'SS'))
/*
Please help me on the below issue.
Requirements:
In a file it has 4 fields. In these fields we may have special character’s like “ä, ö, ü and ß”. So we need to convert these special characters into “AU,OE,UE and SS”. Here we need to replace a single character with 2 character.
If we replace these, it should use the remaining spaces of the corresponding fields.
For an example:
Here the special character “ä” has to be changed as “AU”. This special character might come anywhere in the below fields. So We need to replace this without any displacement in the other fields. Since it should use the spaces which are available in the corresponding fields.it should not change the starting position of other fields.
Since every field is having some extra spaces, so OUTREC FINDREP should use these extra spaces while replacing it. Please help me on this.
Dept User id Name Area code
Code (10-35 length) (36-55 length) (56-69 length)
(1-9 length)
01 816 2138201656011656IM FANG IM FANG FR1 83320
01 817 2138101656001656JAUN JAUN FR1 83319
01 818 843201657001657ABLäNDSCHEN ABLäNDSCHEN BE1 83320
01 818 843201657001657ABLAUNDSCHEN ABLAUNDSCHEN BE1 83320
01 818 843201657001657ABLAUNDSCHEN ABLAUNDSCHEN BE1 83320
01 819 2126201654001654CERNIAT FR CERNIAT FR FR2 83320
Sort condition which I used:
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FINDREP=(INOUT=(C'ä',C'AE',C'ö',C'OE',
C'ü',C'UE',C'ß',C'SS'))
/*
Thanks
Velu.
Velu.
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
Have a loiok at the documentation of FINDREP. You can limit the bytes it looks at, and specify whether data will be shifted during a replacement. However, I don't know if it will work for you, as you are extending bytes which have data following the single source byte. If not, you'll have to relocate each field, where depends on your RECFM, FINDREP the field there, and then put the amended field back where it came from and remember to revert to the original record-lenght by dropping the extended data.
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