MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sort/Utility Questions

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Mainframe Challenge
View previous topic :: View next topic  
Author Message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Wed May 26, 2004 7:46 am    Post subject: Sort/Utility Questions Reply with quote

1.How to force sort to abend when a particular condition is not met? i.e I have an input file and I am looking for 'kolusu' in the first 6 bytes of a file. If the file does not have a single matching record then the job should abend. The trick is to get this done in one step. Icetool can be used but only one pass of the data

2. What is the simplest way to delete all the members of a PDS without deleting the pds itself?

3. I need to print the first 5 lines of every member in my PDS. You can use any utility to achieve this?

4. I need every 3rd line in a seq file as well as in a PDS. If the input is a PDS then I need every 3rd line from ALL the members


I will post the solutions on Friday

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Brian
Beginner


Joined: 12 Aug 2003
Posts: 95
Topics: 6

PostPosted: Thu May 27, 2004 4:16 am    Post subject: Reply with quote

Here we go.

1. A new NULLOUT installation (ICEMAC) and run-time option allows you to specify what you want DFSORT to do when there are no records for the SORTOUT data set. This gives you control over the action (continue or terminate), type of message (informational or error) and return code (0, 4 or 16) for a SORTOUT data set with no records.

http://www.storage.ibm.com/software/sort/mvs/summary_changes/srtmsocc.html#p14b

Accordingly,

Code:

//STEP0001 EXEC PGM=ICEMAN,PARM='NULLOUT=RC16'
//SORTIN    DD    DSN=
//SORTOUT DD    DSN=
//SYSOUT   DD    SYSOUT=*
//SYSIN      DD    *
 OPTION COPY
 INCLUDE COND=(1,6,CH,EQ,C'KOLUSU')
/*
//*


2. I have a rexx solution to delete members from a pds without deleting the pds.

Code:

/* REXX */                                                       
ADDRESS "ISPEXEC"                                                 
"CONTROL ERRORS RETURN"                                           
DSNAME="INPUT.PDS.NAME"
ADDRESS TSO "FREE FI(INDD)"                                       
ADDRESS TSO "ALLOC FI(INDD) DA('"DSNAME"') SHR REU"               
"LMINIT DATAID(DSID) DDNAME(INDD) ENQ(SHR)"                       
"LMOPEN DATAID("DSID") OPTION(INPUT)"                             
"LMMLIST DATAID("DSID") OPTION(LIST) MEMBER(MEMNAME) STATS(NO)"   
LMRC = RC                                                         
DO WHILE LMRC = 0                                                 
   MEMNAM = STRIP(MEMNAME)                                       
   INDSN = DSNAME !! "(" !! MEMNAM !! ")"                         
   ADDRESS TSO "DELETE '"DSNAME"("MEMNAM")'"                     
   "LMMLIST DATAID("DSID") OPTION(LIST) MEMBER(MEMNAME) STATS(NO)"
   LMRC = RC                                                     
END                                                               
"LMCLOSE DATAID("DSID")"                                         
ADDRESS TSO "FREE FI(INDD)"
EXIT 0                     


For 3 and 4 i use FILEAID

To print the first 5 lines from any dataset ...
Code:

//STEP0000 EXEC PGM=FILEAID                         
//DD01     DD   DSN=INPUT
//DD01O    DD   SYSOUT=*                             
//SYSPRINT DD   SYSOUT=*                             
//SYSIN    DD   *                                   
$$DD01 COPY DUMP=5                                   
/*                                                   
//*                             


To print only the third line from any dataset ...
Code:

//STEP0000 EXEC PGM=FILEAID                                   
//DD01     DD   DSN=INPUT
//DD01O    DD   SYSOUT=*                                     
//SYSPRINT DD   SYSOUT=*                                     
//SYSIN    DD   *                                             
$$DD01 COPY SELECT=3
/*                                                         
//*                       


Cheers
Brian
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Thu May 27, 2004 8:04 am    Post subject: Reply with quote

Brian,

The following is the rating for your posts.

Code:

1. 10*
2. 8
3. 0
4. 10

Total: 28



* Your Job assumes that the RC16=ABE is the default parm. The shipped default is NORC16. However I give you full pointings because most shops have RC16=ABE as their default.

As far as I remember the parm DUMP in file-aid is used to print the dataset in hex. The hex listing will be re-directed to syslist, the DD01O will contain all the records from the input.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
taltyman
JCL Forum Moderator
JCL Forum Moderator


Joined: 02 Dec 2002
Posts: 310
Topics: 8
Location: Texas

PostPosted: Thu May 27, 2004 10:33 am    Post subject: Reply with quote

here's one for 3 however it sticks a member name line between each set of lines.
Code:

//STEP1    EXEC PGM=IEBPTPCH                       
//SYSPRINT DD  SYSOUT=*                             
//SYSUT1   DD  DSNAME=MY.PDS,DISP=SHR       
//SYSUT2   DD  SYSOUT=*                             
//SYSIN    DD  *                                   
        PUNCH  TYPORG=PO,STOPAFT=5
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Fri May 28, 2004 8:19 am    Post subject: Reply with quote

1. Force Sort to Abend when a condition is not met.

Code:

//STEP0100 EXEC PGM=SORT,PARM='RC16=ABE'   
//SYSOUT   DD SYSOUT=*                     
//SORTIN   DD *                             
FRANK                                       
BITHEAD                                     
RAVI                                       
//SORTOUT  DD SYSOUT=*                     
//SYSIN    DD *                             
  OPTION NULLOUT=RC16                       
  SORT FIELDS=COPY                           
  INCLUDE COND=(1,6,CH,EQ,C'KOLUSU')         
/*



2. Simplest way to delete all members of a PDS

With the latest version of ISPF (version 5.2) open the PDS in EDIT/BROWSE mode and type the following command at the command prompt.

Code:

 S * D


This will prompt a delete confirmation pop up window and you can set member delete confirmation off and Press Enter

Viola all the members are deleted

3 .print the first 5 lines of every member in my PDS
Code:

//**********************************************************************
//* THE FOLLOWING STEP PRINTS THE FIRST 5 LINES OF EVERY MEMBER OF PDS *
//**********************************************************************
//STEP0100 EXEC PGM=IEBPTPCH                                           
//SYSPRINT DD  SYSOUT=*                                                 
//SYSUT1   DD  DSN=YOUR PDS,                               
//             DISP=SHR                                                 
//SYSUT2   DD  SYSOUT=*                                                 
//SYSIN    DD  *                                                       
  PUNCH TYPORG=PO,STOPAFT=5                                             
/*                                                                     


4.Print every 3rd line in a seq file as well as in a PDS.
Code:

//**********************************************************************
//* THE FOLLOWING STEP PRINTS THE EVERY 3rd LINE OF EVERY MEMBER OF PDS*
//**********************************************************************
//STEP0100 EXEC PGM=IEBPTPCH                                           
//SYSPRINT DD  SYSOUT=*                                                 
//SYSUT1   DD  DSNAME=YOUR PDS,                               
//             DISP=SHR                                                 
//SYSUT2   DD  SYSOUT=*                                                 
//SYSIN    DD  *                                                       
  PUNCH TYPORG=PO,SKIP=3                                               
/*     
//**********************************************************************
//* THE FOLLOWING STEP PRINTS THE EVERY 3rd LINE OF SEQ FILE           *
//**********************************************************************
//STEP0200 EXEC PGM=IEBPTPCH                                           
//SYSPRINT DD  SYSOUT=*                                                 
//SYSUT1   DD  DSNAME=YOUR SEQ FILE,                               
//             DISP=SHR                                                 
//SYSUT2   DD  SYSOUT=*                                                 
//SYSIN    DD  *                                                       
  PUNCH TYPORG=PS,SKIP=3                                               
/*     


Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
advoss
Beginner


Joined: 23 Aug 2005
Posts: 26
Topics: 0

PostPosted: Wed Aug 30, 2006 8:57 am    Post subject: Reply with quote

Kolusu, it appears that your solution to number 4 prints all lines of each member of PDS starting at the third line. Don't you need a STOPAFT=? if you only want the third line?
_________________
Alan Voss
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Wed Aug 30, 2006 9:04 am    Post subject: Reply with quote

advoss wrote:
Kolusu, it appears that your solution to number 4 prints all lines of each member of PDS starting at the third line. Don't you need a STOPAFT=? if you only want the third line?


advoss,

Code:

SKIP=n
specifies that every n(th) record (or physical block in the case of VS or VBS records longer than 32K bytes) is printed or punched.


So don't need a STOPAFT. To verify you can run the sample job provided above.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
advoss
Beginner


Joined: 23 Aug 2005
Posts: 26
Topics: 0

PostPosted: Wed Aug 30, 2006 9:16 am    Post subject: Reply with quote

Oops! I apologize; I did not read the challenge carefully enough.

Thank you.
_________________
Alan Voss
Back to top
View user's profile Send private message
t431jam
Beginner


Joined: 17 Oct 2006
Posts: 1
Topics: 0

PostPosted: Tue Oct 17, 2006 9:38 am    Post subject: Reply with quote

Good Morning

Is there a way to print every member of a PDS (regardless of length) without having to specify a fixed length as shown in the above examples?
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Tue Oct 17, 2006 11:00 am    Post subject: Reply with quote

Did you try the TSO PRINTDS command?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Tue Oct 17, 2006 1:15 pm    Post subject: Reply with quote

t431jam wrote:
Good Morning

Is there a way to print every member of a PDS (regardless of length) without having to specify a fixed length as shown in the above examples?


You can also use the solution listed here(Just remove the stopaft parm in sysin card)

http://www.mvsforums.com/helpboards/viewtopic.php?p=11038#11038
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
gayathri
Beginner


Joined: 01 Aug 2007
Posts: 2
Topics: 1

PostPosted: Thu Aug 02, 2007 2:08 am    Post subject: Reply with quote

hi,

Can we copy a input file of Record Type FB to an Output File of Record type VB?

just clarify me? Question
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Thu Aug 02, 2007 7:11 am    Post subject: Reply with quote

gayathri,


Please do NOT post questions seeking help in this mainframe challenge forum. There are other forums in this board for help questions (utilities, jcl...)

Also please search before posting. check this link

http://www.mvsforums.com/helpboards/viewtopic.php?t=5336

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Alain Benveniste
Beginner


Joined: 04 May 2003
Posts: 92
Topics: 4
Location: Paris, France

PostPosted: Sat Aug 04, 2007 10:30 am    Post subject: Reply with quote

I thought to participate into a new dfsort challenge...
(Un)fortunately no. That misses.

Alain
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Mainframe Challenge All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group