View previous topic :: View next topic |
Author |
Message |
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Wed May 26, 2004 7:46 am Post subject: Sort/Utility Questions |
|
|
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 |
|
|
Brian Beginner
Joined: 12 Aug 2003 Posts: 95 Topics: 6
|
Posted: Thu May 27, 2004 4:16 am Post subject: |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Thu May 27, 2004 8:04 am Post subject: |
|
|
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 |
|
|
taltyman JCL Forum Moderator
Joined: 02 Dec 2002 Posts: 310 Topics: 8 Location: Texas
|
Posted: Thu May 27, 2004 10:33 am Post subject: |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Fri May 28, 2004 8:19 am Post subject: |
|
|
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.
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 |
|
|
advoss Beginner
Joined: 23 Aug 2005 Posts: 26 Topics: 0
|
Posted: Wed Aug 30, 2006 8:57 am Post subject: |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Wed Aug 30, 2006 9:04 am Post subject: |
|
|
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 |
|
|
advoss Beginner
Joined: 23 Aug 2005 Posts: 26 Topics: 0
|
Posted: Wed Aug 30, 2006 9:16 am Post subject: |
|
|
Oops! I apologize; I did not read the challenge carefully enough.
Thank you. _________________ Alan Voss |
|
Back to top |
|
|
t431jam Beginner
Joined: 17 Oct 2006 Posts: 1 Topics: 0
|
Posted: Tue Oct 17, 2006 9:38 am Post subject: |
|
|
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 |
|
|
superk Advanced
Joined: 19 Dec 2002 Posts: 684 Topics: 5
|
Posted: Tue Oct 17, 2006 11:00 am Post subject: |
|
|
Did you try the TSO PRINTDS command? |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
gayathri Beginner
Joined: 01 Aug 2007 Posts: 2 Topics: 1
|
Posted: Thu Aug 02, 2007 2:08 am Post subject: |
|
|
hi,
Can we copy a input file of Record Type FB to an Output File of Record type VB?
just clarify me? |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
Alain Benveniste Beginner
Joined: 04 May 2003 Posts: 92 Topics: 4 Location: Paris, France
|
Posted: Sat Aug 04, 2007 10:30 am Post subject: |
|
|
I thought to participate into a new dfsort challenge...
(Un)fortunately no. That misses.
Alain |
|
Back to top |
|
|
|
|