View previous topic :: View next topic |
Author |
Message |
pzmohanty Beginner
Joined: 20 May 2004 Posts: 97 Topics: 43 Location: hyderabad, India
|
Posted: Sun Apr 02, 2006 1:13 pm Post subject: Create Records based on Count using Syncsort |
|
|
Hi ,
I have a input file which is of RECFM=FB & LRECL=85,
The contents of the input file looks like :-
Code: |
1-------------------------80----85
XXXXXXXXXXXXXXXXXX 00002
YYYYYYYYYYYYYYYYYYYYY 00001
ZZZZZZZZZZZZZZZZZZ 00003
|
Requirement is to create a output file of RECFM=FB & LRECL=80 , where the contents of the output file looks like :
Code: |
1-------------------------80
XXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXX
YYYYYYYYYYYYYYYYYYYYY
ZZZZZZZZZZZZZZZZZZ
ZZZZZZZZZZZZZZZZZZ
ZZZZZZZZZZZZZZZZZZ
|
The input file's last 5 bytes contain the count of the occurence of the record to be written in output file.
As record 1 in input file has 2 in its last 5 bytes, thus record #1 of input file must occur twice in output file.
As our shop uses Syncsort , can this problem be solved using Syncsort.
Thanks in advance. _________________ Priya Ranjan Mohanty
Consultant
Kanbay Software (I) pvt. Ltd.
Hyderabad |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Sun Apr 02, 2006 3:56 pm Post subject: |
|
|
pzmohanty,
What is the max count value in pos 81? since it is bytes 99999 is the maximum ?
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
pzmohanty Beginner
Joined: 20 May 2004 Posts: 97 Topics: 43 Location: hyderabad, India
|
Posted: Sun Apr 02, 2006 11:55 pm Post subject: |
|
|
Hi Kolusu,
Thats right , as you said , the maximum value for the last 5 bytes of input file can be 99999.
Thanks _________________ Priya Ranjan Mohanty
Consultant
Kanbay Software (I) pvt. Ltd.
Hyderabad |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Mon Apr 03, 2006 4:46 am Post subject: |
|
|
pzmohanty,
I don't think it is feasible to achieve the desired results using traditional features of Sort. If your shop has easytrieve then the following JCL will give you the desired results.
Code: |
//STEP0100 EXEC PGM=EZTPA00
//STEPLIB DD DSN=EASYTREV.LOADLIB,
// DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSSNAP DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//INFILE DD DSN=YOUR INPUT FILE,
// DISP=SHR
//OUTFILE DD DSN=YOUR OUTPUT DUPE FILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(X,Y),RLSE),
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=0)
//SYSIN DD *
FILE INFILE
IN-REC 01 80 A
IN-CNT 81 05 N
FILE OUTFILE FB(0 0)
OUT-REC 01 80 A
W-CNT W 05 N
JOB INPUT INFILE
W-CNT = 1
DO UNTIL W-CNT > IN-CNT
OUT-REC = IN-REC
PUT OUTFILE
W-CNT = W-CNT + 1
END-DO
/*
|
Hope this helps....
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
pzmohanty Beginner
Joined: 20 May 2004 Posts: 97 Topics: 43 Location: hyderabad, India
|
Posted: Mon Apr 03, 2006 1:28 pm Post subject: |
|
|
Hi Kolusu,
Thanks a lot for your quick help.. _________________ Priya Ranjan Mohanty
Consultant
Kanbay Software (I) pvt. Ltd.
Hyderabad |
|
Back to top |
|
|
|
|