IBM MAINFRAME HELP & SUPPORT FORUMS
Technical Forums for IBM Mainframe Applications like COBOL, JCL, CICS, DB2, FileAid, DFSORT, Endevor, Xpediter, CoolGen, CA-7&11, AbendAid, IMS, IDMS, PL/I, MqSeries, SyncSort, Assembler, ChangeMan, Easytrieve, InterTest, REXX, CLIST etc...
 

Use Line numbers dynamically in SKIPREC

THIS IS AN ARCHIVE FORUM: CLICK HERE TO GO TO THE ORIGINAL TOPIC

 
       IBMMAINFRAMES.com - IBM Mainframe Support Forums Index -> DFSORT/ICETOOL
View previous topic :: View next topic  
Author Message
ramyar_15



Joined: 30 Jul 2008
Posts: 5
Location: Chennai

Posted: Sat Aug 02, 2008 3:18 pm    Post subject: Use Line numbers dynamically in SKIPREC  

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



Joined: 23 Nov 2006
Posts: 8733
Location: 221 B Baker St

Posted: Sat Aug 02, 2008 9:56 pm    Post subject:  

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



Joined: 18 Jul 2007
Posts: 1199
Location: At my desk

Posted: Sat Aug 02, 2008 11:01 pm    Post subject:  

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



Joined: 30 Jul 2008
Posts: 5
Location: Chennai

Posted: Tue Aug 05, 2008 4:39 pm    Post subject:  

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



Joined: 23 Nov 2006
Posts: 8733
Location: 221 B Baker St

Posted: Tue Aug 05, 2008 8:42 pm    Post subject:  

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



Joined: 15 Feb 2005
Posts: 4613
Location: San Jose, CA

Posted: Tue Aug 05, 2008 10:44 pm    Post subject:  

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:

Code:
D
E


If that's not what you want, then you need to explain more clearly what you do want.
Back to top  
ramyar_15



Joined: 30 Jul 2008
Posts: 5
Location: Chennai

Posted: Wed Aug 06, 2008 1:07 pm    Post subject: Reply to: Use Line numbers dynamically in SKIPREC  

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



Joined: 23 Nov 2006
Posts: 8733
Location: 221 B Baker St

Posted: Wed Aug 06, 2008 1:10 pm    Post subject:  

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



Joined: 30 Jul 2008
Posts: 5
Location: Chennai

Posted: Wed Aug 06, 2008 1:14 pm    Post subject: Reply to: Use Line numbers dynamically in SKIPREC  

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



Joined: 28 Jul 2006
Posts: 664

Posted: Wed Aug 06, 2008 1:27 pm    Post subject:  

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



Joined: 30 Jul 2008
Posts: 5
Location: Chennai

Posted: Wed Aug 06, 2008 1:58 pm    Post subject: Reply to: Use Line numbers dynamically in SKIPREC  

Thank u so much Gerry..
That helped
Back to top  
gcicchet



Joined: 28 Jul 2006
Posts: 664

Posted: Wed Aug 06, 2008 2:04 pm    Post subject:  

By the way Frank's code was obviously not copied correctly


Gerry
Back to top  
 
       IBMMAINFRAMES.com - IBM Mainframe Support Forums Index -> DFSORT/ICETOOL
Page 1 of 1
THIS IS AN ARCIVE FORUM IN READ ONLY MODE. IF YOU WANT TO ASK YOUR DOUBTS USE THE ACTUAL FORUM