View previous topic :: View next topic
|
Author |
Message |
ramyar_15
New User
Joined: 30 Jul 2008 Posts: 5 Location: Chennai
|
|
|
|
Hi,
Can you please tell me how to use dynamic line numbers in SKIPREC.
I want to read the line number from a data set and use it in SKIPREC.
Can anyone help me with this ? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello Ramyar and welcome to the forums,
Please post some sample data, the output you want when that data is processed, and the "rules" for your process. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
There are several good examples that Frank has posted that show how to build Sort control inputs from file information..... |
|
Back to top |
|
|
ramyar_15
New User
Joined: 30 Jul 2008 Posts: 5 Location: Chennai
|
|
|
|
hi...
This is to give more light on my query...
I have 2 files.
Input1
3
Input2
This is line 1..
This is line 2...
This is line 3...
File 1 has the line number.
File 2 has some content.
I need to read the line number from file1 using JCL.
I have to skip ( line number read from file1) line numbers in file2
and display the rest in a new file.
Can anyone please help me with this? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Can anyone please help me with this? |
No one should try until you post the needed info that only you have. . .
What do you want as output from the little sample you've posted? More complete data would probably be good. . .
It should be fairly simple to read file 1 and generate whatever sort control you want if all you want is a skip and copy. . . |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
I need to read the line number from file1 using JCL.
I have to skip ( line number read from file1) line numbers in file2
and display the rest in a new file. |
In your example, file 1 has 3 and file2 has 3 records. So if you mean that you want to use SKIPREC=3 against file2, then the output won't have any records so you can't display the rest. Do you just want to set up the following for use against file2:
Code: |
OPTION COPY,SKIPREC=n
|
where n is the number from file 1? If so, then you can use a DFSORT job like this:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
3
/*
//SORTOUT DD DSN=&&C1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
INREC BUILD=(C' OPTION COPY,SKIPREC=',1,1,80:X)
/*
//S2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
A
B
C
D
E
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD DSN=&&C1,DISP=(OLD,PASS)
|
For this example, SORTOUT for S2 will have:
If that's not what you want, then you need to explain more clearly what you do want. |
|
Back to top |
|
|
ramyar_15
New User
Joined: 30 Jul 2008 Posts: 5 Location: Chennai
|
|
|
|
Thank u so much Frank..
I dint not ask what I wanted clearly but you clearly gave me what I needed.
But I have a problem again.
The Program is abending with ABENDU0016
I am giving you the program
//STEP02 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=FILE1,
// DISP=SHR
//SORTOUT DD DSN=TEMP1,
// DISP=(NEW,CATLG,DELETE),
// DCB=*.SORTIN,
// SPACE=(CYL,(8,10),RLSE)
//SYSIN DD *
OPTION COPY
INREC BUILD=(C'OPTION COPY,SKIPREC=',1,1,80:X)
/*
//STEP03 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSOUD DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSIN DD DSN=TEMP1,DISP=SHR
/*
//SORTIN DD DSN=FILE2,
// DISP=SHR
//SORTOUT DD DSN=FILE3,
// DISP=(NEW,CATLG,DELETE),
// DCB=*.SORTIN,
// SPACE=(CYL,(8,10),RLSE)
I will also give the contents of the files
FILE1
3
FILE2
A
B
C
D
E
FILE3(EXPECTED OUTPUT)
D
E
TEMP HAS THE FOLLOWING
OPTION COPY,SKIPREC=3
BUT STILL IT IS ABENDING..
Please help... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
You need to post all of the diagnostic informaton presented by the abended run. Use copy/paste and include the message numbers as well as the message text. |
|
Back to top |
|
|
ramyar_15
New User
Joined: 30 Jul 2008 Posts: 5 Location: Chennai
|
|
|
|
This is the error messages I get in the abended run
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 03:43 ON WED AUG
OPTION COPY,SKIPREC=3
$
ICE005A 0 STATEMENT DEFINER ERROR
ICE010A 0 NO SORT OR MERGE CONTROL STATEMENT
ICE751I 0 C5-K26318 C6-K90007 E7-K24705
ICE052I 3 END OF DFSORT
Thanks. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
the control statements must not start in col 1.
In your
Code: |
INREC BUILD=(C'OPTION COPY,SKIPREC=',1,1,80:X) |
it should be
Code: |
INREC BUILD=(C' OPTION COPY,SKIPREC=',1,1,80:X) |
Gerry |
|
Back to top |
|
|
ramyar_15
New User
Joined: 30 Jul 2008 Posts: 5 Location: Chennai
|
|
|
|
Thank u so much Gerry..
That helped |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
By the way Frank's code was obviously not copied correctly
Gerry |
|
Back to top |
|
|
|