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
 

 

SORT using a string from a separate file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: SORT using a string from a separate file
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7254

PostPosted: Thu May 24, 2012 6:34 pm    Post subject: Reply to: SORT using a string from a separate file
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    Post subject:
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    Post subject: Reply to: SORT using a string from a separate file
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    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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
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 Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm


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