Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Use Line numbers dynamically in SKIPREC

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
ramyar_15

New User


Joined: 30 Jul 2008
Posts: 5
Location: Chennai

PostPosted: Sat Aug 02, 2008 3:18 pm    Post subject: Use Line numbers dynamically in SKIPREC
Reply with quote

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
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Aug 02, 2008 9:56 pm    Post subject:
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Sat Aug 02, 2008 11:01 pm    Post subject:
Reply with quote

There are several good examples that Frank has posted that show how to build Sort control inputs from file information.....
Back to top
View user's profile Send private message
ramyar_15

New User


Joined: 30 Jul 2008
Posts: 5
Location: Chennai

PostPosted: Tue Aug 05, 2008 4:39 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Aug 05, 2008 8:42 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Tue Aug 05, 2008 10:44 pm    Post subject:
Reply with quote

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
View user's profile Send private message
ramyar_15

New User


Joined: 30 Jul 2008
Posts: 5
Location: Chennai

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

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Aug 06, 2008 1:10 pm    Post subject:
Reply with quote

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
View user's profile Send private message
ramyar_15

New User


Joined: 30 Jul 2008
Posts: 5
Location: Chennai

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

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed Aug 06, 2008 1:27 pm    Post subject:
Reply with quote

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
View user's profile Send private message
ramyar_15

New User


Joined: 30 Jul 2008
Posts: 5
Location: Chennai

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

Thank u so much Gerry..
That helped
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed Aug 06, 2008 2:04 pm    Post subject:
Reply with quote

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


Gerry
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Incorrect output when trying to add n... monica1 PL/I & Assembler 10 Fri Jan 13, 2017 5:02 pm
No new posts Row-Numbers of distinct rows? Auryn DB2 1 Thu Oct 20, 2016 4:38 pm
No new posts Insert Lines in JCL with Rexx after a... Willy Jensen CLIST & REXX 3 Tue Aug 30, 2016 4:18 pm
No new posts how to DYNAMICALLY write sort cond to... mohamedmubee COBOL Programming 13 Fri Aug 26, 2016 11:46 pm
No new posts PL/I: opening file w/ dynamically det... Sam Dodgers PL/I & Assembler 6 Wed Jul 27, 2016 4:05 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us