Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 6968
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: 7315

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 Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us