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
 

 

extracting qalifier from dataset into output file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
useit

Active User


Joined: 05 Oct 2006
Posts: 141

PostPosted: Thu Jun 27, 2013 4:13 pm    Post subject: extracting qalifier from dataset into output file
Reply with quote

hi all,


how can we extract dsn qualifier into output file?


say for examples. i have a pds names as below.

Code:
userid.input11.dataset
userid.input12.dataset
userid.input13.dataset
userid.input14.dataset
userid.input15.dataset
userid.input16.dataset
userid.input17.dataset


i want to extract 5th and 6th fields from second qualifier of dataset and write into out file.

from the above example my output should have

Code:
11
12
13
14
15
16
17


regds,
useit
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Jun 27, 2013 4:22 pm    Post subject:
Reply with quote

SORT, REXX, COBOL ............. etc etc
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Thu Jun 27, 2013 4:25 pm    Post subject:
Reply with quote

How do you get the pds names or from where you get the pds names?
Back to top
View user's profile Send private message
useit

Active User


Joined: 05 Oct 2006
Posts: 141

PostPosted: Thu Jun 27, 2013 4:43 pm    Post subject:
Reply with quote

thanks.those pds names are standard and fixed.
Back to top
View user's profile Send private message
useit

Active User


Joined: 05 Oct 2006
Posts: 141

PostPosted: Thu Jun 27, 2013 4:45 pm    Post subject:
Reply with quote

i searched in the forum but i did not get any similar eamples.
i never worked on rexx. if you can tel me any similar examplesusing sort i would be really thankful to you

Regds,
useit
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Thu Jun 27, 2013 4:48 pm    Post subject:
Reply with quote

Useit,

So you need to retrieve the pds names through based on some crieria and then pick only 6th and 7th byte to output file?
Back to top
View user's profile Send private message
useit

Active User


Joined: 05 Oct 2006
Posts: 141

PostPosted: Thu Jun 27, 2013 5:39 pm    Post subject:
Reply with quote

yes pandora,
your understanding is right:). pick only 6th and 7th byte to output file
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Thu Jun 27, 2013 5:42 pm    Post subject:
Reply with quote

Use Rexx using ISPF services to retrieve PDS names and then store the 6th and 7th byte of second qualifier in stem variable
Write the stem variable to output file
Back to top
View user's profile Send private message
useit

Active User


Joined: 05 Oct 2006
Posts: 141

PostPosted: Thu Jun 27, 2013 5:50 pm    Post subject:
Reply with quote

i have never worked on rex. how can this be done using sort? i
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: Thu Jun 27, 2013 8:14 pm    Post subject:
Reply with quote

Hello,

Show an example of the input file that has the dataset names and explain how this dataset was generated.

Once the file of dataset names has been build, the Sort shoule be a COPY and reformat the output as you want.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Jun 28, 2013 6:22 am    Post subject:
Reply with quote

Hi,

does this help
Code:
//STEP0001 EXEC PGM=SORT                           
//SYSOUT   DD SYSOUT=*                             
//SORTIN   DD *                                     
USERID.INPUT11.DATASET                             
USERID.INPUT12.DATASET                             
USERID.INPUT13.DATASET                             
USERID.INPUT14.DATASET                             
USERID.INPUT15.DATASET                             
USERID.INPUT16.DATASET                             
USERID.INPUT17.DATASET                             
//SORTOUT  DD SYSOUT=*                             
//SYSIN    DD *                                     
  SORT FIELDS=COPY                                 
  INREC PARSE=(%=(ENDAT=C'.'),                     
               %02=(ENDBEFR=C'.',FIXLEN=8)),       
        BUILD=(%02)                                 
 OUTREC BUILD=(6,2)                                 
/*                                                 


Gerry
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Fri Jun 28, 2013 7:05 am    Post subject:
Reply with quote

Gerry,

Do we really need parse here?
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Fri Jun 28, 2013 7:19 am    Post subject: Reply to: extracting qalifier from dataset into output file
Reply with quote

Call an Assembler sub-program and issue a RDJFCB Macro. The DSN can be found in the first 44-bytes of the JFCB area. Define the DCB with a fake DD name and pass the "real" DD name (from the JCL) to the sub-program as a parameter as well as a 44-byte area which will hold the DSN from the JFCB area, passed back to the caller. Each file needs to be closed to the sub-program (a RDJFCB requirement).

The sub-program's RMODE must be 24. AMODE can be either 24 or 31.

HTH....
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Jun 28, 2013 7:43 am    Post subject:
Reply with quote

Hi Pandora,

possibly not but not all qualifiers will always be the same length.


Gerry
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Jun 28, 2013 11:57 am    Post subject: Reply to: extracting qalifier from dataset into output file
Reply with quote

For a specific solution with exactly the form of data shown, PARSE would not be needed.

useit has seen enough SORT solutions to be able to do the simple case, so I'm guessing more complexity, so I'd go for PARSE also.

With IFTHEN=WHEN=(INIT the OUTREC would not be needed.

To make things more flexible, enrico's technique of "right justification" would get the last two digits of the 2nd qualifier always in the same position, no matter how long the qualifier. The only "tricky" part would be the length-one qualifier :-)
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


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