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
 

 

Changing Columns in a VARIABLE LENGTH FILE
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
zawx

New User


Joined: 28 Feb 2008
Posts: 21
Location: china

PostPosted: Sat Jul 24, 2010 2:57 pm    Post subject: Changing Columns in a VARIABLE LENGTH FILE
Reply with quote

INPUT(VARIABLE FILE, MAX LENGTH IS 11):
AAABBB01X
AAABBB02XX
AAABBB03XXX

OUTPUT EXCEPT:
BBBAAA01X
BBBAAA02XX
BBBAAA03XXX

JCL:

SORT FIELDS=COPY
RECORD TYPE=V
OUTREC FIELDS=(5,8,3,8,4,3,11,11,5)

ERROR:
ICE126A 0 INCONSISTENT *OUTREC IFTHEN 0 REFORMATTING FIELD FOUND
Back to top
View user's profile Send private message

smijoss

Active User


Joined: 30 Aug 2007
Posts: 114
Location: pune

PostPosted: Sat Jul 24, 2010 3:08 pm    Post subject: Reply to: HOW TO CHANGE A COLUMN TO B COLUMN (VARIABLE LENGT
Reply with quote

you are missing the length

fir VB file outrec should start as

outrec fields=(1,4,<rest as u want>)[/quote]
Back to top
View user's profile Send private message
zawx

New User


Joined: 28 Feb 2008
Posts: 21
Location: china

PostPosted: Sat Jul 24, 2010 3:21 pm    Post subject:
Reply with quote

But the first record length little than max length,
out error:
x BYTE VARIABLE RECORD IS SHORTER THAN y BYTE MINIMUM FOR
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Sat Jul 24, 2010 6:41 pm    Post subject:
Reply with quote

wouldn't this be easier?
Code:
  OPTION COPY                       
  INREC OVERLAY=(5:8,3,8:5,3)     

Some lite reading might help your understanding....
z/OS V1R11.0 DFSORT: Getting Started
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Sun Jul 25, 2010 2:37 am    Post subject:
Reply with quote

CICS Guy,

Just curious if you had tested your job and verified output!!!

Thanks,
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Sun Jul 25, 2010 5:05 am    Post subject:
Reply with quote

sqlcode1 wrote:
Just curious if you had tested your job and verified output!!!
Yea, like my coffee table has a MF in it.....
move one column value to another column in a sequential file gave me the info that an OVERLAY could provide the needed solution....
That and INREC Statement Notes
When INREC is specified, DFSORT reformats the input records after user exit E15 or INCLUDE/OMIT statement processing is finished.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Sun Jul 25, 2010 5:48 am    Post subject:
Reply with quote

CICS Guy,
I apologize if my comments sounded offensive. No, I don't think you would have MF terminal at your coffee table. icon_smile.gificon_smile.gificon_smile.gif

I am not trying to correct you but rather just pointing to the fact that you are overlaying 5th through 7th bytes with values from 8th through 10th bytes and later overlaying 8th through 10th bytes with values from 5th through 7th bytes(which had been overlaid previously). So it should be repeatation of the field(BBB). Please correct me if I am wrong.

Regarding post "move one columns value...", OP wanted to overlay FIELD10 position with SPACES and hence no question about preserving values stored in FIELD10. Here OP needs to shuffle fields and hence needs to preserve both the values.

Unfortunately, I am having connectivity issues and can't test yours as well as my untested version but I promise to test my solution and post it later.


Thanks,
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Sun Jul 25, 2010 6:12 am    Post subject:
Reply with quote

sqlcode1 wrote:
but rather just pointing to the fact that you are overlaying 5th through 7th bytes with values from 8th through 10th bytes and later overlaying 8th through 10th bytes with values from 5th through 7th bytes(which had been overlaid previously). So it should be repeatation of the field(BBB). Please correct me if I am wrong.

Regarding post "move one columns value...", OP wanted to overlay FIELD10 position with SPACES and hence no question about preserving values stored in FIELD10. Here OP needs to shuffle fields and hence needs to preserve both the values.
No problem...
Just going on my underlying belief that the simpler explanation is probably the answer, I am assuming the the sort does not modify in place, i.e., the source data is not overlaid and the destination data is not contaminated by a prior move (something we programmers have to be aware of when we code... icon_wink.gif ).
Overlapping moves are either a disaster or a very 'artful' technique, depending on if you intend to do it......grin....

I'm sure Frank or Skolusu will either confirm or 'cut me a new one' come next week..... icon_lol.gif
Back to top
View user's profile Send private message
zawx

New User


Joined: 28 Feb 2008
Posts: 21
Location: china

PostPosted: Sun Jul 25, 2010 7:23 am    Post subject:
Reply with quote

As sqlcode1 say, the result error.
icon_sad.gif
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Sun Jul 25, 2010 7:34 am    Post subject:
Reply with quote

zawx,

try this untested.

Code:
 
 OPTION COPY                       
 INREC BUILD=(1,4,5:8,3,8:5,3,11,4)


Thanks,
Back to top
View user's profile Send private message
zawx

New User


Joined: 28 Feb 2008
Posts: 21
Location: china

PostPosted: Sun Jul 25, 2010 7:40 am    Post subject:
Reply with quote

sqlcode1 wrote:
zawx,

try this untested.

Code:
 
 OPTION COPY                       
 INREC BUILD=(1,4,5:8,3,8:5,3,11,[color=red]4[/color])


Thanks,


output error:
x BYTE VARIABLE RECORD IS SHORTER THAN y BYTE MINIMUM FOR

because not every record have max length.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Sun Jul 25, 2010 7:52 am    Post subject:
Reply with quote

zawx wrote:
output error:
x BYTE VARIABLE RECORD IS SHORTER THAN y BYTE MINIMUM FOR
Please display the FULL error including the error message number!
And, while you are at it, the entire sysout.... icon_rolleyes.gif
Back to top
View user's profile Send private message
zawx

New User


Joined: 28 Feb 2008
Posts: 21
Location: china

PostPosted: Sun Jul 25, 2010 7:58 am    Post subject: Reply to: HOW TO CHANGE A COLUMN TO B COLUMN (VARIABLE LENGT
Reply with quote

ICE218A n BYTE VARIABLE RECORD IS SHORTER THAN m BYTE MINIMUM FOR [ddname] FIELDS

sysin is:

SORT FIELDS=COPY
RECORD TYPE=V
INREC BUILD=(1,4,5:5,3,8:5,3,11,4)
Back to top
View user's profile Send private message
zawx

New User


Joined: 28 Feb 2008
Posts: 21
Location: china

PostPosted: Sun Jul 25, 2010 8:04 am    Post subject:
Reply with quote

input file

RBA Len <===5===10====5===20====5===30==>.5...40....5...50....
0 268 000000000000000000000000000000000
0 136 241000299800000138828920190501001..................N0.
0 136 241000299800999999346420190501001..................N0.
0 136 241000299800999999346620190501001..................N0.
0 136 242000299800000138828920190501001..................N0.
0 136 242000299800000138830520190501001..................N0.
0 136 242000299800000138831320190501001..................N0.
0 136 242000299800000138833920190501001..................N0.
0 136 242000299800000138847920190501001..................N0.
0 136 242000299800000138853720190501001..................N0.
0 136 242000299800000138908920190501001..................Y0.

expected output:
0002998000001388289241

1,3 exchange 4,19

use the sysin

SORT FIELDS=COPY
RECORD TYPE=V
OUTREC BUILD=(1,4,5:8,19,24:5,3,2) VLSCMP

output:
0000000000000000000000 000000000000000000000000000000000
0002998000001388289241 241000299800000138828920190501001 N0
0002998009999993464241 241000299800999999346420190501001 N0
0002998009999993466241 241000299800999999346620190501001 N0
0002998000001388289242 242000299800000138828920190501001 N0
0002998000001388305242 242000299800000138830520190501001 N0
0002998000001388313242 242000299800000138831320190501001 N0
0002998000001388339242 242000299800000138833920190501001 N0
0002998000001388479242 242000299800000138847920190501001 N0
0002998000001388537242 242000299800000138853720190501001 N0
0002998000001389089242 242000299800000138908920190501001 Y0
0002998000001389097242i 242000299800000138909720190501001 N0
0002998000001389105242i 242000299800000138910520190501001 N0
0002998000001389113242i 242000299800000138911320190501001 N0
0002998000001389121242i 242000299800000138912120190501001 N0
0002998000001389261242i 242000299800000138926120190501001 N0
0002998000001389279242i 242000299800000138927920190501001 N0
0002998000001389345242i 242000299800000138934520190501001 N0
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Sun Jul 25, 2010 8:30 am    Post subject:
Reply with quote

zawx wrote:
ERROR:
ICE126A 0 INCONSISTENT *OUTREC IFTHEN 0 REFORMATTING FIELD FOUND

zawx wrote:
ICE218A n BYTE VARIABLE RECORD IS SHORTER THAN m BYTE MINIMUM FOR [ddname] FIELDS
Please quit providing what you think we need, provide the entire sysins and sysouts of your original problem!

BTW, what is anybody going to make of this:
zawx wrote:
input file

RBA Len <===5===10====5===20====5===30==>.5...40....5...50....
0 268 000000000000000000000000000000000
0 136 241000299800000138828920190501001..................N0.
0 136 241000299800999999346420190501001..................N0.
0 136 241000299800999999346620190501001..................N0.
0 136 242000299800000138828920190501001..................N0.
0 136 242000299800000138830520190501001..................N0.
0 136 242000299800000138831320190501001..................N0.
0 136 242000299800000138833920190501001..................N0.
0 136 242000299800000138847920190501001..................N0.
0 136 242000299800000138853720190501001..................N0.
0 136 242000299800000138908920190501001..................Y0.
Vs this:
Quote:
input file

Code:
RBA        Len     <===5===10====5===20====5===30==>.5...40....5...50....
0           268    000000000000000000000000000000000                     
0           136    241000299800000138828920190501001..................N0.
0           136    241000299800999999346420190501001..................N0.
0           136    241000299800999999346620190501001..................N0.
0           136    242000299800000138828920190501001..................N0.
0           136    242000299800000138830520190501001..................N0.
0           136    242000299800000138831320190501001..................N0.
0           136    242000299800000138833920190501001..................N0.
0           136    242000299800000138847920190501001..................N0.
0           136    242000299800000138853720190501001..................N0.
0           136    242000299800000138908920190501001..................Y0.
Back to top
View user's profile Send private message
zawx

New User


Joined: 28 Feb 2008
Posts: 21
Location: china

PostPosted: Sun Jul 25, 2010 8:45 am    Post subject:
Reply with quote

hi, CICS Guy,
in batch process , created record contains key one and key two.
but online process, I want to read all key two records using startbr cics statement.
so, batch file contains key one and key two ,online file contains key two and key one.

but failed exchange key one and key two.

My english is poor, do you understand?
Back to top
View user's profile Send private message
zawx

New User


Joined: 28 Feb 2008
Posts: 21
Location: china

PostPosted: Sun Jul 25, 2010 9:08 am    Post subject:
Reply with quote

OK,
The source file and target file is variable ,min length 124,max length 268

source:
key1 key2 data

key1 3BYTE
key2 19BYTE

target:
key2 key1 data

how to code the sysin ?

I have tried as :

SORT FIELDS=COPY
RECORD TYPE=V
INREC BUILD=(1,4,5:8,19,24:5,3,27)
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Sun Jul 25, 2010 9:15 am    Post subject:
Reply with quote

zawx wrote:
in batch process , created record contains key one and key two.
but online process, I want to read all key two records using startbr cics statement.
so, batch file contains key one and key two ,online file contains key two and key one.

but failed exchange key one and key two.

My english is poor, do you understand?
NO, I do not understand....
CICS Guy wrote:
Please quit providing what you think we need, provide the entire sysins and sysouts of your original problem!
Please provide the information needed to solve your problem!
Quote:
how to code the sysin ?
Cut&paste the sysouts!
Back to top
View user's profile Send private message
zawx

New User


Joined: 28 Feb 2008
Posts: 21
Location: china

PostPosted: Sun Jul 25, 2010 9:19 am    Post subject:
Reply with quote

Code:

ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED                                                                         
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AND MORE                                   
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 10:55 ON SUN JUL 25, 2010 -                             
           SORT FIELDS=COPY                                                                                             
           RECORD TYPE=V                                                                                                 
           INREC BUILD=(1,4,5:8,19,24:5,3,27:27)                                                                         
ICE201I F RECORD TYPE IS V - DATA STARTS IN POSITION 5                                                                   
ICE751I 0 C5-K90013 C6-K90013 C7-K90000 C8-K42135 EE-BASE   E9-K90013 C9-BASE   E5-K44563 E7-K44563                     
ICE193I 0 ICEAM1 ENVIRONMENT IN EFFECT - ICEAM1 INSTALLATION MODULE SELECTED                                             
ICE088I 0 PARD0XXS.STP0700 .        , INPUT LRECL = 272, BLKSIZE = 8192, TYPE = V                                       
ICE093I 0 MAIN STORAGE = (MAX,6291456,6291456)                                                                           
ICE156I 0 MAIN STORAGE ABOVE 16MB = (6234096,6234096)                                                                   
ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y,RESET=Y,VSAMEMT=Y,DYNSPC=256             
ICE128I 0 OPTIONS: SIZE=6291456,MAXLIM=1048576,MINLIM=450560,EQUALS=N,LIST=Y,ERET=RC16 ,MSGDDN=SYSOUT                   
ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=NO   ,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT=N,DYNALOC=N             ,ABCODE=MSG     
ICE130I 0 OPTIONS: RESALL=4096,RESINV=0,SVC=109 ,CHECK=Y,WRKREL=Y,OUTREL=Y,CKPT=N,STIMER=Y,COBEXIT=COB2                 
ICE131I 0 OPTIONS: TMAXLIM=6291456,ARESALL=0,ARESINV=0,OVERRGN=65536,CINV=Y,CFW=Y,DSA=0                                 
ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE    ,EXITCK=S,PARMDDN=DFSPARM ,FSZEST=N           
ICE133I 0 OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=MAX ,ODMAXBF=0,SOLRF=Y,VLLONG=N,VSAMIO=N,MOSIZE=MAX
ICE235I 0 OPTIONS: NULLOUT=RC0                                                 
ICE084I 1 VSAM ACCESS METHOD USED FOR SORTOUT                                   
ICE084I 1 VSAM ACCESS METHOD USED FOR SORTIN                                   
ICE077A 0 VSAM OUTPUT ERROR L(12) SORTOUT                                       
ICE751I 1 EF-K10929 F0-K30362 E8-K44563                                         
ICE052I 0 END OF DFSORT                                                         
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Sun Jul 25, 2010 9:34 am    Post subject:
Reply with quote

Since, your shuffled fields are part of your VSAM key, I think you need to rebuild your VSAM file and/or key after conversion.


Looking at ICE218A message, you need either of the method from below.

Code:
                       
 INREC BUILD=(1,4,5:8,3,8:5,3,11:11)
 SORT FIELDS=(5,3,CH,A,         --> your key2 from original file
              8,3,CH,A)         --> your key1 from original file


this tells dfsort to copy the bytes from 11th position to the end of record.

You may also try below solution. Again untested..(making me scarred and nervous at the same time)…

Code:
INREC IFTHEN=(WHEN=INIT,OVERLAY=(16:5,3)),             
      IFTHEN=(WHEN=INIT,OVERLAY=(5:8,3,8:16,3,11:11,5))
 SORT FIELDS=(5,3,CH,A,         --> your key2 from original file
              8,3,CH,A)         --> your key1 from original file                                          
OUTREC BUILD=(1,15) 



CICS Guy,
I think he means to say, he has 2 process (Batch and Online) reading the same input file and these 2 processes expects data by 2 different keys.

1) For CICS he is creating VSAM file by KEY1,KEY2 order.
2) For Batch process, he is creating VSAM file by KEY2,KEY1 order.

Meanwhile, I am not currently working on CICS but I think you really don't have to create one more version of file to meet your requirement.


Thanks,
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
Goto page 1, 2  Next
Page 1 of 2

 

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
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 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