IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SORT using a string from a separate file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Yvonne1980

New User


Joined: 31 Aug 2010
Posts: 20
Location: Edinburgh

PostPosted: Thu May 24, 2012 6:10 pm
Reply with quote

I'm trying to pick up a date from a pds member, rearrange it and place in the header of my sortout file. I can't figure out how to tell sort to get the required string from a file ?

The PDS member is a FB 80 file with the the date in the following layout DD/MM/YYYY occupying the first 10 chars of the PDS member:
Example PDS: XXXX.YYYY.ZZZZ(TODAY)
Code:
24/05/2012

My SORTIN file is a FB 60 file that requires the date from the PDS to be inserted at col 20 in the format YYYYMMDD, the rest of the header should remain unchanged:
The rest of the SORTIN detail and trailer recs should be copied unchanged

Example input:
Code:
0XXXXXXXXXXXXXXXXXX20120401YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
1Record001
1Record002
1Record003
1Record004
1Record005
9Trailer

Desired output (only the header date has changed):
Code:
0XXXXXXXXXXXXXXXXXX20120524YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
1Record001
1Record002
1Record003
1Record004
1Record005
9Trailer


Many thanks.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu May 24, 2012 6:21 pm
Reply with quote

one way would be:

step one:
extract date from pds and create a sysname.

step two:
use the sysname to overlay the file header.

there are various examples in the dfsort forum.

sorry, i am not into searching for you.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu May 24, 2012 6:34 pm
Reply with quote

Have a look here for that which dbz has suggested.
Back to top
View user's profile Send private message
Yvonne1980

New User


Joined: 31 Aug 2010
Posts: 20
Location: Edinburgh

PostPosted: Thu May 24, 2012 7:07 pm
Reply with quote

SYMBOLS and SYMNAMES .... smashing !!!
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu May 24, 2012 8:50 pm
Reply with quote

Yvonne1980,

Assuming that your header record begins with a zero and is the only header then you can use the following joinkeys job

Code:

//STEP0100 EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//INA      DD *                                                       
0XXXXXXXXXXXXXXXXXX20120401YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY         
1RECORD001                                                           
1RECORD002                                                           
1RECORD003                                                           
1RECORD004                                                           
1RECORD005                                                           
9TRAILER                                                             
//INB      DD *                                                       
----+----1----+----2----+----3----+----4----+----5----+----6----+----7
24/05/2012                                                           
//SORTOUT  DD SYSOUT=*                                               
//SYSIN    DD *                                                       
  OPTION COPY                                                         
  JOINKEYS F1=INA,FIELDS=(1,1,A),SORTED,NOSEQCK                       
  JOINKEYS F2=INB,FIELDS=(1,1,A),SORTED,NOSEQCK                       
  JOIN UNPAIRED                                                       
  REFORMAT FIELDS=(F1:1,60,?,F2:2,8)                                 
  INREC IFOUTLEN=60,IFTHEN=(WHEN=(61,1,CH,EQ,C'B'),OVERLAY=(20:62,8))
//*
//JNF2CNTL DD *                                                       
  INREC BUILD=(C'0',7,4,4,2,1,2)                                     
//*
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top