![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| I want records in file2 those are not exist in file1 | suresh3566 | Shell Programming and Scripting | 3 | 10-27-2008 05:59 AM |
| Filtering records of a file based on a value of a column | risk_sly | UNIX for Dummies Questions & Answers | 4 | 09-24-2008 03:22 AM |
| Check valid records in really big file with one commend.. | vtischuk@yahoo. | Shell Programming and Scripting | 3 | 05-18-2008 04:54 PM |
| Count No of Records in File without counting Header and Trailer Records | guiguy | Shell Programming and Scripting | 2 | 06-07-2007 01:15 PM |
| Select records based on search criteria on first column | shashi_kiran_v | UNIX for Dummies Questions & Answers | 2 | 12-02-2005 01:49 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Based on num of records in file1 need to check records in file2 to set some condns
Hi All,
I have two files say file1 and file2. I want to check the number of records in file1 and if its atleast 2 (i.e., 2 or greater than 2 ) then I have to check records in file2 .If records in file2 is atleast 1 (i.e. if its not empty ) i have to set some conditions . Could you pls help me what would be the perl script look like , i dont knw the syntax As 'm new in this business any help is appreciated . it wud be sumthng like IF (file1 has atleast 2 records ) IF(file2 has atleast 1 record) set condition1 END ELSE- set condition2 Currently we are using IDCAMS in mainframes to do this ...but it needs to be converted to perl scripts.If you want more elaboration , the IDCAMS code is //STEP02 EXEC PGM=IDCAMS,COND=(0,NE) //SYSPRINT DD SYSOUT=(,),OUTPUT=(*.JESP) //ARCHIVO DD DSN=PRODAS.AS07.ARCHIVE(+0),DISP=(OLD,PASS) //ARCHIVN DD DSN=PRODAS.AS07.ARCHIVE(+1),DISP=(OLD,PASS) //SYSIN DD * PRINT INFILE(ARCHIVO) COUNT(2) IF LASTCC = 0 THEN - DO PRINT INFILE(ARCHIVN) COUNT(1) IF atleast one IF LASTCC=4 THEN - SET MAXCC=1 END ELSE - IF LASTCC=4 THEN - SET MAXCC=0 /* |
| Bookmarks |
| Tags |
| shell script, shell scripting, unix scripting, unix scripting basics |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|